OSDN Git Service

x86: use raw opcode for xgetbv instruction
authorMans Rullgard <mans@mansr.com>
Sun, 20 Feb 2011 14:38:32 +0000 (14:38 +0000)
committerMans Rullgard <mans@mansr.com>
Sun, 20 Feb 2011 17:31:23 +0000 (17:31 +0000)
This allows the CPU detection to work with assemblers not supporting
the xgetbv mnemonic.  These include clang and some BSD versions.

All AVX code will be written for yasm, where the main assembler
is not involved.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil/x86/cpu.c

index 2caac2f..14d0fe1 100644 (file)
@@ -36,7 +36,7 @@
          : "0" (index));
 
 #define xgetbv(index,eax,edx)                                   \
-    __asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c" (index))
+    __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
 
 /* Function to test if multimedia instructions are supported...  */
 int ff_get_cpu_flags_x86(void)