Enable SSE2 for Visual Studio builds

Based on the remnants of change #2273.
Adds an auto-detect for ARCH based on the environment.

Change-Id: I4644eae7509f3982a8b385b49beac03675a2e0e8
This commit is contained in:
James Zern
2011-05-31 18:58:01 -07:00
parent af10db4aa4
commit 003417c7c7
3 changed files with 16 additions and 11 deletions

View File

@ -685,9 +685,12 @@ static inline void GetCPUInfo(int cpu_info[4], int info_type) {
: "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
: "a"(info_type));
}
#elif defined(_M_IX86) || defined(_M_X64) // Visual C++
#define GetCPUInfo __cpuid
#endif
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(__x86_64__) || \
defined(_M_IX86) || defined(_M_X64)
static int x86CPUInfo(CPUFeature feature) {
int cpu_info[4];
GetCPUInfo(cpu_info, 1);
@ -753,7 +756,8 @@ void VP8EncDspInit(void) {
// If defined, use CPUInfo() to overwrite some pointers with faster versions.
if (VP8GetCPUInfo) {
if (VP8GetCPUInfo(kSSE2)) {
#if defined(__SSE2__)
#if defined(__SSE2__) || \
(defined(_M_IX86_FP) && _M_IX86_FP >= 2) || defined(_M_X64)
VP8EncDspInitSSE2();
#endif
}

View File

@ -9,7 +9,8 @@
//
// Author: Christian Duvivier (cduvivier@google.com)
#if defined(__SSE2__)
#if defined(__SSE2__) || \
(defined(_M_IX86_FP) && _M_IX86_FP >= 2) || defined(_M_X64)
#include <emmintrin.h>
#include "vp8enci.h"