[vlc-commits] [Git][videolan/vlc][master] 3 commits: cpu: drop unused MMXEXT flag
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Fri Feb 25 13:05:19 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
56e43fab by Rémi Denis-Courmont at 2022-02-25T12:12:07+00:00
cpu: drop unused MMXEXT flag
- - - - -
77e29e39 by Rémi Denis-Courmont at 2022-02-25T12:12:07+00:00
cpu: remove dead code
(and fix unused warning)
- - - - -
1754b12d by Rémi Denis-Courmont at 2022-02-25T12:12:07+00:00
cpu: refactor #ifdef'ery
The two big long ifdef's are identical except for the i486 case, so
take that particular case out and factor the rest.
No functional changes except for removing a no-op CPUID call on i586+.
- - - - -
3 changed files:
- include/vlc_cpu.h
- src/linux/cpu.c
- src/misc/cpu.c
Changes:
=====================================
include/vlc_cpu.h
=====================================
@@ -42,7 +42,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
@@ -64,11 +63,9 @@ unsigned vlc_CPU_raw(void);
# 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
=====================================
src/linux/cpu.c
=====================================
@@ -125,9 +125,7 @@ unsigned vlc_CPU_raw(void)
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"))
=====================================
src/misc/cpu.c
=====================================
@@ -116,7 +116,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__)
@@ -135,9 +134,10 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
: "cc");
# endif
/* Check if the OS really supports the requested instructions */
-# if defined (__i386__) && !defined (__i486__) && !defined (__i586__) \
+# if defined (__i386__) && !defined (__i586__) \
&& !defined (__i686__) && !defined (__pentium4__) \
&& !defined (__k6__) && !defined (__athlon__) && !defined (__k8__)
+# if !defined (__i486__)
/* check if cpuid instruction is supported */
asm volatile ("push %%ebx\n\t"
"pushf\n\t"
@@ -161,17 +161,10 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
/* the CPU supports the CPUID instruction - get its level */
cpuid( 0x00000000 );
-# if defined (__i386__) && !defined (__i586__) \
- && !defined (__i686__) && !defined (__pentium4__) \
- && !defined (__k6__) && !defined (__athlon__) && !defined (__k8__)
if( !i_eax )
goto out;
#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__)
@@ -180,8 +173,6 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
# 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
@@ -209,8 +200,6 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
/* 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__ ) \
@@ -257,8 +246,6 @@ void vlc_CPU_dump (vlc_object_t *obj)
#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())
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/38d5ee479dcc355951bc4efdb44be85fde43d333...1754b12dd06e4a0b7dde19a339cab6d3f403d331
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/38d5ee479dcc355951bc4efdb44be85fde43d333...1754b12dd06e4a0b7dde19a339cab6d3f403d331
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list