]> git.sesse.net Git - x264/blobdiff - common/cpu.c
force unroll macroblock_load_pic_pointers
[x264] / common / cpu.c
index a486793e8be1cacb023baeb55b9c94356d0c8ce6..47a72f769ca13c93e67ee384022cff0cb6409c4f 100644 (file)
 
 #include "common.h"
 
+const struct {
+    const char name[8];
+    int flags;
+} x264_cpu_names[] = {
+    {"MMX",     X264_CPU_MMX},
+    {"MMX2",    X264_CPU_MMX|X264_CPU_MMXEXT},
+    {"MMXEXT",  X264_CPU_MMX|X264_CPU_MMXEXT},
+    {"SSE",     X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_SSE},
+    {"SSE1",    X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_SSE},
+    {"SSE2",    X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_SSE|X264_CPU_SSE2},
+    {"SSE3",    X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_SSE|X264_CPU_SSE2|X264_CPU_SSE3},
+    {"SSSE3",   X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_SSE|X264_CPU_SSE2|X264_CPU_SSE3|X264_CPU_SSSE3},
+    {"3DNow",   X264_CPU_3DNOW},
+    {"Altivec", X264_CPU_ALTIVEC},
+    {"Cache32", X264_CPU_CACHELINE_SPLIT|X264_CPU_CACHELINE_32},
+    {"Cache64", X264_CPU_CACHELINE_SPLIT|X264_CPU_CACHELINE_64},
+    {"", 0},
+};
+
 #ifdef HAVE_MMX
 extern int  x264_cpu_cpuid_test( void );
 extern uint32_t  x264_cpu_cpuid( uint32_t op, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx );
-extern void x264_emms( void );
 
 uint32_t x264_cpu_detect( void )
 {
@@ -66,12 +84,10 @@ uint32_t x264_cpu_detect( void )
         cpu |= X264_CPU_MMXEXT|X264_CPU_SSE;
     if( edx&0x04000000 )
         cpu |= X264_CPU_SSE2;
-#ifdef HAVE_SSE3
     if( ecx&0x00000001 )
         cpu |= X264_CPU_SSE3;
     if( ecx&0x00000200 )
         cpu |= X264_CPU_SSSE3;
-#endif
 
     x264_cpu_cpuid( 0x80000000, &eax, &ebx, &ecx, &edx );
     max_extended_cap = eax;
@@ -127,14 +143,6 @@ uint32_t x264_cpu_detect( void )
     return cpu;
 }
 
-void     x264_cpu_restore( uint32_t cpu )
-{
-    if( cpu&(X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_3DNOW|X264_CPU_3DNOWEXT) )
-    {
-        x264_emms();
-    }
-}
-
 #elif defined( ARCH_PPC )
 
 #ifdef SYS_MACOSX
@@ -198,10 +206,6 @@ uint32_t x264_cpu_detect( void )
 }
 #endif
 
-void     x264_cpu_restore( uint32_t cpu )
-{
-}
-
 #else
 
 uint32_t x264_cpu_detect( void )
@@ -209,10 +213,12 @@ uint32_t x264_cpu_detect( void )
     return 0;
 }
 
-void     x264_cpu_restore( uint32_t cpu )
+#endif
+
+#ifndef HAVE_MMX
+void x264_emms( void )
 {
 }
-
 #endif