]> git.sesse.net Git - ffmpeg/commitdiff
x86: Drop CPU detection intrinsics
authorDiego Biurrun <diego@biurrun.de>
Wed, 3 Oct 2012 15:57:53 +0000 (17:57 +0200)
committerDiego Biurrun <diego@biurrun.de>
Thu, 4 Oct 2012 17:29:14 +0000 (19:29 +0200)
Now that there is CPU detection in YASM, there will always be one of
inline or external assembly enabled, which obviates the need to fall
back on CPU detection through compiler intrinsics.

configure
libavutil/x86/cpu.c

index 4c3ebdb28120ce63e4baf0735b251090949a0041..cd72f3637601808c20c53639c688fee42d2592cf 100755 (executable)
--- a/configure
+++ b/configure
@@ -1138,7 +1138,6 @@ HAVE_LIST="
     cbrtf
     closesocket
     cmov
-    cpuid
     cpunop
     dcbzl
     dev_bktr_ioctl_bt848_h
@@ -1206,7 +1205,6 @@ HAVE_LIST="
     rint
     round
     roundf
-    rweflags
     sched_getaffinity
     sdl
     sdl_video_size
@@ -1250,7 +1248,6 @@ HAVE_LIST="
     windows_h
     winsock2_h
     xform_asm
-    xgetbv
     xmm_clobbers
 "
 
@@ -3070,10 +3067,7 @@ elif enabled sparc; then
 
 elif enabled x86; then
 
-    check_code ld immintrin.h "return __xgetbv(0)" && enable xgetbv
-    check_code ld intrin.h "int info[4]; __cpuid(info, 0)" && enable cpuid
     check_code ld intrin.h "__rdtsc()" && enable rdtsc
-    check_code ld intrin.h "unsigned int x = __readeflags()" && enable rweflags
 
     check_code ld mmintrin.h "_mm_empty()" && enable mm_empty
 
index fb1dd299bc540ecd1921a48b26c512e20213d441..5b658d1bedcd93812a833ff36d8f2d2f0dffc012 100644 (file)
         "xchg   %%"REG_b", %%"REG_S                             \
         : "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx)        \
         : "0" (index))
-#elif HAVE_CPUID
-#include <intrin.h>
 
-#define cpuid(index, eax, ebx, ecx, edx)        \
-    do {                                        \
-        int info[4];                            \
-        __cpuid(info, index);                   \
-        eax = info[0];                          \
-        ebx = info[1];                          \
-        ecx = info[2];                          \
-        edx = info[3];                          \
-    } while (0)
-#endif /* HAVE_CPUID */
-
-#if HAVE_INLINE_ASM
 #define xgetbv(index, eax, edx)                                 \
     __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
-#elif HAVE_XGETBV
-#include <immintrin.h>
-
-#define xgetbv(index, eax, edx)                 \
-    do {                                        \
-        uint64_t res = __xgetbv(index);         \
-        eax = res;                              \
-        edx = res >> 32;                        \
-    } while (0)
-#endif /* HAVE_XGETBV */
-
-#if HAVE_INLINE_ASM
 
 #define get_eflags(x)                           \
     __asm__ volatile ("pushfl     \n"           \
                       "popfl      \n"           \
                       :: "r"(x))
 
-#elif HAVE_RWEFLAGS
-
-#include <intrin.h>
-
-#define get_eflags(x)                           \
-    x = __readeflags()
-
-#define set_eflags(x)                           \
-    __writeeflags(x)
-
 #endif /* HAVE_INLINE_ASM */
 
 #if ARCH_X86_64