From 434e1e0592eff711cbae22f97dbbc0956c86779e Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sun, 17 Jan 2010 10:57:20 +0100 Subject: [PATCH] Revert "Win32: use IsProcessorFeaturePresent() to detect available instructions" This reverts commit 4b5229c80508c84dbb28b834c5955e1177d9f779. --- src/misc/cpu.c | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/src/misc/cpu.c b/src/misc/cpu.c index 3640865e9c..b09debb2fd 100644 --- a/src/misc/cpu.c +++ b/src/misc/cpu.c @@ -40,9 +40,6 @@ #include #else #include -#include -#include -#define PF_SSE3_INSTRUCTIONS_AVAILABLE 13 #endif #include "libvlc.h" @@ -172,12 +169,12 @@ uint32_t CPUCapabilities( void ) /* test for the MMX flag */ cpuid( 0x00000001 ); - # if !defined (__MMX__) if( ! (i_edx & 0x00800000) ) goto out; # endif i_capabilities |= CPU_CAPABILITY_MMX; + # if defined (__SSE__) i_capabilities |= CPU_CAPABILITY_MMXEXT | CPU_CAPABILITY_SSE; # else @@ -186,13 +183,8 @@ uint32_t CPUCapabilities( void ) i_capabilities |= CPU_CAPABILITY_MMXEXT; # ifdef CAN_COMPILE_SSE -# ifdef WIN32 - if( IsProcessorFeaturePresent( PF_XMMI_INSTRUCTIONS_AVAILABLE ) ) - i_capabilities |= CPU_CAPABILITY_SSE; -# else check_capability( "SSE", CPU_CAPABILITY_SSE, "xorps %%xmm0,%%xmm0\n" ); -# endif # endif } # endif @@ -201,66 +193,40 @@ uint32_t CPUCapabilities( void ) i_capabilities |= CPU_CAPABILITY_SSE2; # elif defined (CAN_COMPILE_SSE2) if( i_edx & 0x04000000 ) - { -# ifdef WIN32 - if( IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE ) ) - i_capabilities |= CPU_CAPABILITY_SSE2; -# else check_capability( "SSE2", CPU_CAPABILITY_SSE2, "movupd %%xmm0, %%xmm0\n" ); -# endif - } # endif # if defined (__SSE3__) i_capabilities |= CPU_CAPABILITY_SSE3; # elif defined (CAN_COMPILE_SSE3) if( i_ecx & 0x00000001 ) - { -# ifdef WIN32 - if( IsProcessorFeaturePresent( PF_SSE3_INSTRUCTIONS_AVAILABLE ) ) - i_capabilities |= CPU_CAPABILITY_SSE3; -# else check_capability( "SSE3", CPU_CAPABILITY_SSE3, "movsldup %%xmm1, %%xmm0\n" ); -# endif - } # endif # if defined (__SSSE3__) i_capabilities |= CPU_CAPABILITY_SSSE3; # elif defined (CAN_COMPILE_SSSE3) -# ifdef WIN32 - /* FIXME: IsProcessorFeaturePresent can't check for SSSE3 */ -# else if( i_ecx & 0x00000200 ) check_capability( "SSSE3", CPU_CAPABILITY_SSSE3, "pabsw %%xmm1, %%xmm0\n" ); -# endif # endif # if defined (__SSE4_1__) i_capabilities |= CPU_CAPABILITY_SSE4_1; # elif defined (CAN_COMPILE_SSE4_1) -# ifdef WIN32 - /* FIXME: IsProcessorFeaturePresent can't check for SSE4.1 */ -# else if( i_ecx & 0x00080000 ) check_capability( "SSE4.1", CPU_CAPABILITY_SSE4_1, "pmaxsb %%xmm1, %%xmm0\n" ); -# endif # endif # if defined (__SSE4_2__) i_capabilities |= CPU_CAPABILITY_SSE4_2; # elif defined (CAN_COMPILE_SSE4_2) -# ifdef WIN32 - /* FIXME: IsProcessorFeaturePresent can't check for SSE4.2 */ -# else if( i_ecx & 0x00100000 ) check_capability( "SSE4.2", CPU_CAPABILITY_SSE4_2, "pcmpgtq %%xmm1, %%xmm0\n" ); -# endif # endif /* test for additional capabilities */ @@ -275,17 +241,9 @@ uint32_t CPUCapabilities( void ) # if defined (__3dNOW__) i_capabilities |= CPU_CAPABILITY_3DNOW; # elif defined (CAN_COMPILE_3DNOW) - if( i_edx & 0x80000000 ) - { -# ifdef WIN32 - if( IsProcessorFeaturePresent( PF_3DNOW_INSTRUCTIONS_AVAILABLE ) ) - i_capabilities |= CPU_CAPABILITY_3DNOW; -# else check_capability( "3D Now!", CPU_CAPABILITY_3DNOW, "pfadd %%mm0,%%mm0\n" "femms\n" ); -# endif - } # endif if( b_amd && ( i_edx & 0x00400000 ) ) -- 2.39.2