mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
Simplify Visual Studio ifdefs
Use _MSC_VER as the intrinsics compile without /arch:SSE2 on x86. Also avoids applying the same flag to all files which defeated the purpose of the runtime cpu-detection. Thanks to Frank B. for the suggestion! Change-Id: Iae9933a3cee704e663d9bbd53d0fa68e8c025425
This commit is contained in:
parent
ca7a2fd66d
commit
b2b0090b4c
@ -27,7 +27,6 @@ If cl.exe is in your PATH rerun nmake with ARCH=<arch>.
|
||||
|
||||
!IF "$(ARCH)" == "x86"
|
||||
PLATFORM_LDFLAGS = /SAFESEH
|
||||
PLATFORM_SSE2 = /arch:SSE2
|
||||
!ENDIF
|
||||
|
||||
#############################################################
|
||||
@ -43,7 +42,6 @@ LNKDLL = link.exe /DLL
|
||||
LNKLIB = link.exe /lib
|
||||
LNKEXE = link.exe
|
||||
LFLAGS = /nologo /machine:$(ARCH)
|
||||
CFLAGS = $(CFLAGS) $(PLATFORM_SSE2)
|
||||
|
||||
CFGSET = FALSE
|
||||
!IF "$(OBJDIR)" == ""
|
||||
|
@ -685,12 +685,11 @@ 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++
|
||||
#elif defined(_MSC_VER) // Visual C++
|
||||
#define GetCPUInfo __cpuid
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__) || \
|
||||
defined(_M_IX86) || defined(_M_X64)
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER)
|
||||
static int x86CPUInfo(CPUFeature feature) {
|
||||
int cpu_info[4];
|
||||
GetCPUInfo(cpu_info, 1);
|
||||
@ -756,8 +755,7 @@ void VP8EncDspInit(void) {
|
||||
// If defined, use CPUInfo() to overwrite some pointers with faster versions.
|
||||
if (VP8GetCPUInfo) {
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
#if defined(__SSE2__) || \
|
||||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2) || defined(_M_X64)
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
VP8EncDspInitSSE2();
|
||||
#endif
|
||||
}
|
||||
|
@ -9,8 +9,7 @@
|
||||
//
|
||||
// Author: Christian Duvivier (cduvivier@google.com)
|
||||
|
||||
#if defined(__SSE2__) || \
|
||||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2) || defined(_M_X64)
|
||||
#if defined(__SSE2__) || defined(_MSC_VER)
|
||||
#include <emmintrin.h>
|
||||
|
||||
#include "vp8enci.h"
|
||||
|
Loading…
Reference in New Issue
Block a user