#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 )
{
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;
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
}
#endif
-void x264_cpu_restore( uint32_t cpu )
-{
-}
-
#else
uint32_t x264_cpu_detect( void )
return 0;
}
-void x264_cpu_restore( uint32_t cpu )
+#endif
+
+#ifndef HAVE_MMX
+void x264_emms( void )
{
}
-
#endif