[vlc-commits] [Git][videolan/vlc][master] 7 commits: cpu: remove unused MMX flag

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Mon Feb 28 07:51:40 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
7d37a703 by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
cpu: remove unused MMX flag

- - - - -
5db36eeb by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
deinterlace: use correct macro for SSE2

- - - - -
c8128f95 by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
cpu: remove unused SSE1 flag

- - - - -
cecad7a5 by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
cpu: remove unused FMA4 flag

Detection only worked on Linux, but more importantly, this flag fell out of
use with 8512cab6af819bf0223d74feffc862e6c162c89d.

- - - - -
c240b18e by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
cpu: remove unused XOP flag

Detection only worked on Linux, but more importantly, this flag fell out of
use with 8512cab6af819bf0223d74feffc862e6c162c89d.

- - - - -
9d2d171f by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
cpu: remove unused SSE 4.2 flag

This flag fell out of use with 8512cab6af819bf0223d74feffc862e6c162c89d.

- - - - -
fe1083cd by Rémi Denis-Courmont at 2022-02-27T18:11:02+00:00
cpu: remove unused SSE4a flag

Detection only worked on Linux, but more importantly, this flag fell out of
use with 8512cab6af819bf0223d74feffc862e6c162c89d.

- - - - -


6 changed files:

- configure.ac
- include/vlc_cpu.h
- modules/video_filter/deinterlace/merge.c
- modules/video_filter/deinterlace/merge.h
- src/linux/cpu.c
- src/misc/cpu.c


Changes:

=====================================
configure.ac
=====================================
@@ -1361,11 +1361,11 @@ dnl  Accelerated modules
 dnl
 
 dnl  Check for fully working SSE2 intrinsics
-dnl  We need support for -msse[2], we need <emmintrin.h>, and we also need a
+dnl  We need support for -msse2, we need <emmintrin.h>, and we also need a
 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
 AC_ARG_ENABLE([sse],
   AS_HELP_STRING([--disable-sse],
-    [disable SSE (1-4) optimizations (default auto)]),, [
+    [disable SSE (2-4) optimizations (default auto)]),, [
   case "${host_cpu}" in
     i?86|x86_64)
       enable_sse=yes
@@ -1377,7 +1377,7 @@ AC_ARG_ENABLE([sse],
 ])
 have_sse2="no"
 AS_IF([test "${enable_sse}" != "no"], [
-  ARCH="${ARCH} sse sse2"
+  ARCH="${ARCH} sse2"
 
   VLC_SAVE_FLAGS
   CFLAGS="${CFLAGS} -msse2"
@@ -1406,23 +1406,6 @@ frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
   ])
 
   VLC_SAVE_FLAGS
-  CFLAGS="${CFLAGS} -msse"
-  AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
-void *p;
-asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
-]])
-    ], [
-      ac_cv_sse_inline=yes
-    ], [
-      ac_cv_sse_inline=no
-    ])
-  ])
-
-  AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
-    AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
-  ])
-
   AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
 void *p;
@@ -1488,38 +1471,7 @@ asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
   AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
     AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
 
-  # SSE4.2
-  AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
-                 [ac_cv_sse4_2_inline], [
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
-void *p;
-asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
-]])
-    ], [
-      ac_cv_sse4_2_inline=yes
-    ], [
-      ac_cv_sse4_2_inline=no
-    ])
-  ])
-
-  AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
-    AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
-
-  # SSE4A
-  AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
-void *p;
-asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
-]])
-    ], [
-      ac_cv_sse4a_inline=yes
-    ], [
-      ac_cv_sse4a_inline=no
-    ])
-  ])
   VLC_RESTORE_FLAGS
-  AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
-    AC_DEFINE([CAN_COMPILE_SSE4A], [1], [Define to 1 if SSE4A inline assembly is available.]) ])
 ])
 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
 


=====================================
include/vlc_cpu.h
=====================================
@@ -41,32 +41,16 @@ unsigned vlc_CPU_raw(void);
 
 # if defined (__i386__) || defined (__x86_64__)
 #  define HAVE_FPU 1
-#  define VLC_CPU_MMX    0x00000008
-#  define VLC_CPU_SSE    0x00000040
 #  define VLC_CPU_SSE2   0x00000080
 #  define VLC_CPU_SSE3   0x00000100
 #  define VLC_CPU_SSSE3  0x00000200
 #  define VLC_CPU_SSE4_1 0x00000400
-#  define VLC_CPU_SSE4_2 0x00000800
-#  define VLC_CPU_SSE4A  0x00001000
 #  define VLC_CPU_AVX    0x00002000
 #  define VLC_CPU_AVX2   0x00004000
-#  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_SSE() (1)
 #  define VLC_SSE
 # else
-#  define vlc_CPU_SSE() ((vlc_CPU() & VLC_CPU_SSE) != 0)
 #  define VLC_SSE __attribute__ ((__target__ ("sse")))
 # endif
 
@@ -94,18 +78,6 @@ unsigned vlc_CPU_raw(void);
 #  define vlc_CPU_SSE4_1() ((vlc_CPU() & VLC_CPU_SSE4_1) != 0)
 # endif
 
-# ifdef __SSE4_2__
-#  define vlc_CPU_SSE4_2() (1)
-# else
-#  define vlc_CPU_SSE4_2() ((vlc_CPU() & VLC_CPU_SSE4_2) != 0)
-# endif
-
-# ifdef __SSE4A__
-#  define vlc_CPU_SSE4A() (1)
-# else
-#  define vlc_CPU_SSE4A() ((vlc_CPU() & VLC_CPU_SSE4A) != 0)
-# endif
-
 # ifdef __AVX__
 #  define vlc_CPU_AVX() (1)
 #  define VLC_AVX
@@ -120,18 +92,6 @@ unsigned vlc_CPU_raw(void);
 #  define vlc_CPU_AVX2() ((vlc_CPU() & VLC_CPU_AVX2) != 0)
 # endif
 
-# ifdef __XOP__
-#  define vlc_CPU_XOP() (1)
-# else
-#  define vlc_CPU_XOP() ((vlc_CPU() & VLC_CPU_XOP) != 0)
-# endif
-
-# ifdef __FMA4__
-#  define vlc_CPU_FMA4() (1)
-# else
-#  define vlc_CPU_FMA4() ((vlc_CPU() & VLC_CPU_FMA4) != 0)
-# endif
-
 # elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
 #  define HAVE_FPU 1
 #  define VLC_CPU_ALTIVEC 2


=====================================
modules/video_filter/deinterlace/merge.c
=====================================
@@ -63,7 +63,7 @@ void Merge16BitGeneric( void *_p_dest, const void *_p_s1,
         *p_dest++ = ( *p_s1++ + *p_s2++ ) >> 1;
 }
 
-#if defined(CAN_COMPILE_SSE)
+#if defined(CAN_COMPILE_SSE2)
 VLC_SSE
 void Merge8BitSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2,
                     size_t i_bytes )


=====================================
modules/video_filter/deinterlace/merge.h
=====================================
@@ -141,7 +141,7 @@ void Merge16BitGeneric( void *_p_dest, const void *_p_s1, const void *_p_s2,
 void MergeAltivec ( void *, const void *, const void *, size_t );
 #endif
 
-#if defined(CAN_COMPILE_SSE)
+#if defined(CAN_COMPILE_SSE2)
 /**
  * SSE2 routine to blend pixels from two picture lines.
  *


=====================================
src/linux/cpu.c
=====================================
@@ -122,10 +122,6 @@ unsigned vlc_CPU_raw(void)
 
         while ((cap = strsep (&p, " ")) != NULL)
         {
-            if (!strcmp (cap, "mmx"))
-                core_caps |= VLC_CPU_MMX;
-            if (!strcmp (cap, "sse"))
-                core_caps |= VLC_CPU_SSE;
             if (!strcmp (cap, "sse2"))
                 core_caps |= VLC_CPU_SSE2;
             if (!strcmp (cap, "pni"))
@@ -134,18 +130,10 @@ unsigned vlc_CPU_raw(void)
                 core_caps |= VLC_CPU_SSSE3;
             if (!strcmp (cap, "sse4_1"))
                 core_caps |= VLC_CPU_SSE4_1;
-            if (!strcmp (cap, "sse4_2"))
-                core_caps |= VLC_CPU_SSE4_2;
-            if (!strcmp (cap, "sse4a"))
-                core_caps |= VLC_CPU_SSE4A;
             if (!strcmp (cap, "avx"))
                 core_caps |= VLC_CPU_AVX;
             if (!strcmp (cap, "avx2"))
                 core_caps |= VLC_CPU_AVX2;
-            if (!strcmp (cap, "xop"))
-                core_caps |= VLC_CPU_XOP;
-            if (!strcmp (cap, "fma4"))
-                core_caps |= VLC_CPU_FMA4;
         }
 
         /* Take the intersection of capabilities of each processor */


=====================================
src/misc/cpu.c
=====================================
@@ -165,20 +165,12 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
         goto out;
 #endif
 
-    /* test for the MMX flag */
     cpuid( 0x00000001 );
-# if !defined (__MMX__)
-    if( ! (i_edx & 0x00800000) )
-        goto out;
-# endif
-    i_capabilities |= VLC_CPU_MMX;
 
 # if defined (CAN_COMPILE_SSE) && !defined (__SSE__)
     if (( i_edx & 0x02000000 ) && vlc_CPU_check ("SSE", SSE_test))
 # endif
     {
-        /*if( i_edx & 0x02000000 )*/
-            i_capabilities |= VLC_CPU_SSE;
         if (i_edx & 0x04000000)
             i_capabilities |= VLC_CPU_SSE2;
         if (i_ecx & 0x00000001)
@@ -187,8 +179,6 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
             i_capabilities |= VLC_CPU_SSSE3;
         if (i_ecx & 0x00080000)
             i_capabilities |= VLC_CPU_SSE4_1;
-        if (i_ecx & 0x00100000)
-            i_capabilities |= VLC_CPU_SSE4_2;
     }
 
     /* test for additional capabilities */
@@ -244,10 +234,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_SSE())
-        vlc_memstream_puts(&stream, "SSE ");
     if (vlc_CPU_SSE2())
         vlc_memstream_puts(&stream, "SSE2 ");
     if (vlc_CPU_SSE3())
@@ -256,18 +242,10 @@ void vlc_CPU_dump (vlc_object_t *obj)
         vlc_memstream_puts(&stream, "SSSE3 ");
     if (vlc_CPU_SSE4_1())
         vlc_memstream_puts(&stream, "SSE4.1 ");
-    if (vlc_CPU_SSE4_2())
-        vlc_memstream_puts(&stream, "SSE4.2 ");
-    if (vlc_CPU_SSE4A())
-        vlc_memstream_puts(&stream, "SSE4A ");
     if (vlc_CPU_AVX())
         vlc_memstream_puts(&stream, "AVX ");
     if (vlc_CPU_AVX2())
         vlc_memstream_puts(&stream, "AVX2 ");
-    if (vlc_CPU_XOP())
-        vlc_memstream_puts(&stream, "XOP ");
-    if (vlc_CPU_FMA4())
-        vlc_memstream_puts(&stream, "FMA4 ");
 
 #elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
     if (vlc_CPU_ALTIVEC())



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/56db9925fc7351e9b218d85916d6fd9d38ebac54...fe1083cdf555bf768e2228fd2a76dc6cb0b0c434

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/56db9925fc7351e9b218d85916d6fd9d38ebac54...fe1083cdf555bf768e2228fd2a76dc6cb0b0c434
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