Skip to content
Snippets Groups Projects
Commit 321afe4f authored by Lyndon Brown's avatar Lyndon Brown
Browse files

cpu: purge MMX/MMXEXT

notes:
 - the `b_amd` detection was only used in connection to MMXEXT so was also
   removed.
 - the `goto out`s were replaced with `return 0` to avoid the warning that
   can now occur as i experienced.
parent 236432b1
No related branches found
No related tags found
No related merge requests found
......@@ -41,8 +41,6 @@ unsigned vlc_CPU_raw(void);
# if defined (__i386__) || defined (__x86_64__)
# define HAVE_FPU 1
# define VLC_CPU_MMX 0x00000008
# define VLC_CPU_MMXEXT 0x00000020
# define VLC_CPU_SSE 0x00000040
# define VLC_CPU_SSE2 0x00000080
# define VLC_CPU_SSE3 0x00000100
......@@ -55,20 +53,10 @@ unsigned vlc_CPU_raw(void);
# define VLC_CPU_XOP 0x00008000
# define VLC_CPU_FMA4 0x00010000
# if defined (__MMX__)
# define vlc_CPU_MMX() (1)
# define VLC_MMX
# else
# define vlc_CPU_MMX() ((vlc_CPU() & VLC_CPU_MMX) != 0)
# define VLC_MMX __attribute__ ((__target__ ("mmx")))
# endif
# if defined (__SSE__)
# define vlc_CPU_MMXEXT() (1)
# define vlc_CPU_SSE() (1)
# define VLC_SSE
# else
# define vlc_CPU_MMXEXT() ((vlc_CPU() & VLC_CPU_MMXEXT) != 0)
# define vlc_CPU_SSE() ((vlc_CPU() & VLC_CPU_SSE) != 0)
# define VLC_SSE __attribute__ ((__target__ ("sse")))
# endif
......
......@@ -74,12 +74,8 @@ unsigned vlc_CPU_raw(void)
# endif
#elif defined (__i386__) || defined (__x86_64__)
if (!strcmp (cap, "mmx"))
core_caps |= VLC_CPU_MMX;
if (!strcmp (cap, "sse"))
core_caps |= VLC_CPU_SSE | VLC_CPU_MMXEXT;
if (!strcmp (cap, "mmxext"))
core_caps |= VLC_CPU_MMXEXT;
core_caps |= VLC_CPU_SSE;
if (!strcmp (cap, "sse2"))
core_caps |= VLC_CPU_SSE2;
if (!strcmp (cap, "pni"))
......
......@@ -115,7 +115,6 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
#if defined( __i386__ ) || defined( __x86_64__ )
unsigned int i_eax, i_ebx, i_ecx, i_edx;
bool b_amd;
/* Needed for x86 CPU capabilities detection */
# if defined (__i386__) && defined (__PIC__)
......@@ -154,7 +153,7 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
: "cc" );
if( i_eax == i_ebx )
goto out;
return 0;
# endif
/* the CPU supports the CPUID instruction - get its level */
......@@ -164,23 +163,11 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
&& !defined (__i686__) && !defined (__pentium4__) \
&& !defined (__k6__) && !defined (__athlon__) && !defined (__k8__)
if( !i_eax )
goto out;
return 0;
#endif
/* borrowed from mpeg2dec */
b_amd = ( i_ebx == 0x68747541 ) && ( i_ecx == 0x444d4163 )
&& ( i_edx == 0x69746e65 );
/* test for the MMX flag */
cpuid( 0x00000001 );
# if !defined (__MMX__)
if( ! (i_edx & 0x00800000) )
goto out;
# endif
i_capabilities |= VLC_CPU_MMX;
if( i_edx & 0x02000000 )
i_capabilities |= VLC_CPU_MMXEXT;
# if defined (CAN_COMPILE_SSE) && !defined (__SSE__)
if (( i_edx & 0x02000000 ) && vlc_CPU_check ("SSE", SSE_test))
# endif
......@@ -199,19 +186,6 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
i_capabilities |= VLC_CPU_SSE4_2;
}
/* test for additional capabilities */
cpuid( 0x80000000 );
if( i_eax < 0x80000001 )
goto out;
/* list these additional capabilities */
cpuid( 0x80000001 );
if( b_amd && ( i_edx & 0x00400000 ) )
i_capabilities |= VLC_CPU_MMXEXT;
out:
#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __powerpc64__ ) \
|| defined( __ppc64__ )
......@@ -258,10 +232,6 @@ void vlc_CPU_dump (vlc_object_t *obj)
vlc_memstream_open(&stream);
#if defined (__i386__) || defined (__x86_64__)
if (vlc_CPU_MMX())
vlc_memstream_puts(&stream, "MMX ");
if (vlc_CPU_MMXEXT())
vlc_memstream_puts(&stream, "MMXEXT ");
if (vlc_CPU_SSE())
vlc_memstream_puts(&stream, "SSE ");
if (vlc_CPU_SSE2())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment