diff options
author | James Zern <jzern@google.com> | 2015-01-16 16:14:49 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2015-03-03 17:53:42 -0800 |
commit | df1081bb82f5d303ef3f50e8f70987b106a2aa4a (patch) | |
tree | bfbba8e8946a52a3a48a3004f31190520fa3be10 | |
parent | 39aa0555290633bc1120937896bbb386013c6ba4 (diff) | |
download | libwebp-df1081bb82f5d303ef3f50e8f70987b106a2aa4a.tar.gz |
dsp/cpu: (msvs) add include for __cpuidex
and only use it on x86 / x64 where it's available.
has the side-effect of quieting a msvs /analyze warning:
C6001: Using uninitialized memory 'cpu_info'.
(cherry picked from commit 0de5f33e31036c04c020527c3984749bdd292675)
Change-Id: Iae51be3b22b2ee949cfc473eeea9fd9fb6b3c2cb
-rw-r--r-- | src/dsp/cpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dsp/cpu.c b/src/dsp/cpu.c index 7673d0fa..ef04a75a 100644 --- a/src/dsp/cpu.c +++ b/src/dsp/cpu.c @@ -38,7 +38,9 @@ static WEBP_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), "c"(0)); } -#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729 // >= VS2008 SP1 +#elif (defined(_M_X64) || defined(_M_IX86)) && \ + defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729 // >= VS2008 SP1 +#include <intrin.h> #define GetCPUInfo(info, type) __cpuidex(info, type, 0) // set ecx=0 #elif defined(WEBP_MSC_SSE2) #define GetCPUInfo __cpuid |