From e3bf64337e58e7bb2419c31fa7e5f1afb7d43142 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Tue, 25 Nov 2008 18:36:50 +0000 Subject: 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28037 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cpudetect.c b/cpudetect.c index 22edd58795..ffd0705e0e 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -57,10 +57,17 @@ static int has_cpuid(void) 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 @@ static int has_cpuid(void) /* 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; } -- cgit v1.2.3