[FFmpeg-cvslog] x86: use raw opcode for xgetbv instruction

Mans Rullgard git
Tue Feb 22 03:17:16 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sun Feb 20 14:38:32 2011 +0000| [f1f792117f3375478fb0043369014b575dfa5e75] | committer: Michael Niedermayer

x86: use raw opcode for xgetbv instruction

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 at mansr.com>
(cherry picked from commit ef6695387522fc783105ac187c84beaa284e7cff)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1f792117f3375478fb0043369014b575dfa5e75
---

 libavutil/x86/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index 2caac2f..14d0fe1 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -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)




More information about the ffmpeg-cvslog mailing list