# HG changeset patch # User cehoyos # Date 1227638210 0 # Node ID 2c3528928d6b3e8c9a833ee5dd669d028e06feb6 # Parent bcb567424fbc5007303df20c4a8e08e4642f3ceb Replace pushf/popf by explicit pushfl/popfl (32 bit) or pushfq/popfq (x86_64), to fix generated code on ICC 11.0. Original FFmpeg patch by Reimar. diff -r bcb567424fbc -r 2c3528928d6b cpudetect.c --- a/cpudetect.c Tue Nov 25 18:24:23 2008 +0000 +++ b/cpudetect.c Tue Nov 25 18:36:50 2008 +0000 @@ -57,10 +57,17 @@ long a, c; // code from libavcodec: +#ifdef ARCH_X86_64 +#define PUSHF "pushfq\n\t" +#define POPF "popfq\n\t" +#else +#define PUSHF "pushfl\n\t" +#define POPF "popfl\n\t" +#endif __asm__ volatile ( /* See if CPUID instruction is supported ... */ /* ... Get copies of EFLAGS into eax and ecx */ - "pushf\n\t" + PUSHF "pop %0\n\t" "mov %0, %1\n\t" @@ -68,15 +75,17 @@ /* to the EFLAGS reg */ "xor $0x200000, %0\n\t" "push %0\n\t" - "popf\n\t" + POPF /* ... Get the (hopefully modified) EFLAGS */ - "pushf\n\t" + PUSHF "pop %0\n\t" : "=a" (a), "=c" (c) : : "cc" ); +#undef PUSHF +#undef POPF return a != c; }