summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2015-01-12 17:58:57 -0800
committerJames Zern <jzern@google.com>2015-03-03 17:53:41 -0800
commit8508ab99a7df1b77278f0fc305ec2a6307c76928 (patch)
tree352ec30a089ca03c56b759602412f0225fe018f3
parent5769623b6f5e3ea9c4946f198781723807d6bd83 (diff)
downloadlibwebp-8508ab99a7df1b77278f0fc305ec2a6307c76928.tar.gz
cpu: fix AVX2 detection for gcc/clang targets
ecx needs to be set to 0; the visual studio builds were already doing this. https://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family (cherry picked from commit d7c4b02a57bcab6a42ee5b6277c3da39a404e2a7) Change-Id: I95efb115b4d50bbdb6b14fca2aa63d0a24974e55
-rw-r--r--src/dsp/cpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dsp/cpu.c b/src/dsp/cpu.c
index 8754f874..3557ae02 100644
--- a/src/dsp/cpu.c
+++ b/src/dsp/cpu.c
@@ -29,14 +29,14 @@ static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {
"cpuid\n"
"xchg %%edi, %%ebx\n"
: "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
- : "a"(info_type));
+ : "a"(info_type), "c"(0));
}
#elif defined(__i386__) || defined(__x86_64__)
static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {
__asm__ volatile (
"cpuid\n"
: "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
- : "a"(info_type));
+ : "a"(info_type), "c"(0));
}
#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729 // >= VS2008 SP1
#define GetCPUInfo(info, type) __cpuidex(info, type, 0) // set ecx=0