Commit 0fa7047b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Simplify SSE tests

There is no need to test OS support for SSE2, and later. If plain SSE
works, the OS preserves the XMM registers and that's all we care.
parent 971f44a3
...@@ -99,36 +99,6 @@ VLC_SSE static void SSE_test (void) ...@@ -99,36 +99,6 @@ VLC_SSE static void SSE_test (void)
asm volatile ("xorps %%xmm0,%%xmm0\n" : : : "xmm0", "xmm1"); asm volatile ("xorps %%xmm0,%%xmm0\n" : : : "xmm0", "xmm1");
} }
#endif #endif
#if defined (CAN_COMPILE_SSE2) && !defined (__SSE2__)
VLC_SSE static void SSE2_test (void)
{
asm volatile ("movupd %%xmm0, %%xmm0\n" : : : "xmm0", "xmm1");
}
#endif
#if defined (CAN_COMPILE_SSE3) && !defined (__SSE3__)
VLC_SSE static void SSE3_test (void)
{
asm volatile ("movsldup %%xmm1, %%xmm0\n" : : : "xmm0", "xmm1");
}
#endif
#if defined (CAN_COMPILE_SSSE3) && !defined (__SSSE3__)
VLC_SSE static void SSSE3_test (void)
{
asm volatile ("pabsw %%xmm1, %%xmm0\n" : : : "xmm0", "xmm1");
}
#endif
#if defined (CAN_COMPILE_SSE4_1) && !defined (__SSE4_1__)
VLC_SSE static void SSE4_1_test (void)
{
asm volatile ("pmaxsb %%xmm1, %%xmm0\n" : : : "xmm0", "xmm1");
}
#endif
#if defined (CAN_COMPILE_SSE4_2) && !defined (__SSE4_2__)
VLC_SSE static void SSE4_2_test (void)
{
asm volatile ("pcmpgtq %%xmm1, %%xmm0\n" : : : "xmm0", "xmm1");
}
#endif
#if defined (CAN_COMPILE_3DNOW) && !defined (__3dNOW__) #if defined (CAN_COMPILE_3DNOW) && !defined (__3dNOW__)
VLC_MMX static void ThreeD_Now_test (void) VLC_MMX static void ThreeD_Now_test (void)
{ {
...@@ -224,38 +194,24 @@ void vlc_CPU_init (void) ...@@ -224,38 +194,24 @@ void vlc_CPU_init (void)
i_capabilities |= VLC_CPU_MMX; i_capabilities |= VLC_CPU_MMX;
if( i_edx & 0x02000000 ) if( i_edx & 0x02000000 )
{
i_capabilities |= VLC_CPU_MMXEXT; i_capabilities |= VLC_CPU_MMXEXT;
# ifdef CAN_COMPILE_SSE # if defined (CAN_COMPILE_SSE) && !defined (__SSE__)
if (vlc_CPU_check ("SSE", SSE_test)) if (( i_edx & 0x02000000 ) && vlc_CPU_check ("SSE", SSE_test))
i_capabilities |= VLC_CPU_SSE;
# endif # endif
} {
/*if( i_edx & 0x02000000 )*/
# if defined (CAN_COMPILE_SSE2) i_capabilities |= VLC_CPU_SSE;
if ((i_edx & 0x04000000) && vlc_CPU_check ("SSE2", SSE2_test)) if (i_edx & 0x04000000)
i_capabilities |= VLC_CPU_SSE2; i_capabilities |= VLC_CPU_SSE2;
# endif if (i_ecx & 0x00000001)
# if defined (CAN_COMPILE_SSE3)
if ((i_ecx & 0x00000001) && vlc_CPU_check ("SSE3", SSE3_test))
i_capabilities |= VLC_CPU_SSE3; i_capabilities |= VLC_CPU_SSE3;
# endif if (i_ecx & 0x00000200)
# if defined (CAN_COMPILE_SSSE3)
if ((i_ecx & 0x00000200) && vlc_CPU_check ("SSSE3", SSSE3_test))
i_capabilities |= VLC_CPU_SSSE3; i_capabilities |= VLC_CPU_SSSE3;
# endif if (i_ecx & 0x00080000)
# if defined (CAN_COMPILE_SSE4_1)
if ((i_ecx & 0x00080000) && vlc_CPU_check ("SSE4.1", SSE4_1_test))
i_capabilities |= VLC_CPU_SSE4_1; i_capabilities |= VLC_CPU_SSE4_1;
# endif if (i_ecx & 0x00100000)
# if defined (CAN_COMPILE_SSE4_2)
if ((i_ecx & 0x00100000) && vlc_CPU_check ("SSE4.2", SSE4_2_test))
i_capabilities |= VLC_CPU_SSE4_2; i_capabilities |= VLC_CPU_SSE4_2;
# endif }
/* test for additional capabilities */ /* test for additional capabilities */
cpuid( 0x80000000 ); cpuid( 0x80000000 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment