diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2008-11-25 21:12:01 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2008-11-25 21:12:01 +0200 |
commit | 835511ac394d5283c9c449e6154ccb0db1365321 (patch) | |
tree | c223ee6b82481a0030273cfae9e831dada249fd8 /cpudetect.c | |
parent | 6c712271ce9e8d4eb9cd615e920139ebcb1d1d49 (diff) | |
parent | cc5e0406412a5f8b4e6e7094f6ffa18a65decd74 (diff) | |
download | mpv-835511ac394d5283c9c449e6154ccb0db1365321.tar.bz2 mpv-835511ac394d5283c9c449e6154ccb0db1365321.tar.xz |
Merge svn changes up to r28038
Diffstat (limited to 'cpudetect.c')
-rw-r--r-- | cpudetect.c | 15 |
1 files 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; } |