[vlc-commits] [Git][videolan/vlc][master] 3 commits: deinterlace: purge 3dNow

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Wed Jul 14 09:12:17 UTC 2021



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


Commits:
327bf56c by Lyndon Brown at 2021-07-14T08:49:42+00:00
deinterlace: purge 3dNow

- - - - -
118ede5b by Lyndon Brown at 2021-07-14T08:49:42+00:00
configure: purge 3dNow

- - - - -
75bca603 by Lyndon Brown at 2021-07-14T08:49:42+00:00
purge all remaining 3dNow artefacts

- - - - -


11 changed files:

- configure.ac
- include/vlc_cpu.h
- modules/codec/libmpeg2.c
- modules/video_chroma/swscale.c
- modules/video_filter/deinterlace/deinterlace.c
- modules/video_filter/deinterlace/merge.c
- modules/video_filter/deinterlace/merge.h
- modules/video_filter/deinterlace/mmx.h
- modules/video_filter/postproc.c
- src/linux/cpu.c
- src/misc/cpu.c


Changes:

=====================================
configure.ac
=====================================
@@ -1683,28 +1683,6 @@ asm volatile("vpunpckhqdq %%ymm1,%%ymm2,%%ymm3"::"r"(p):"ymm1", "ymm2", "ymm3");
 ])
 AM_CONDITIONAL([HAVE_AVX2], [test "$have_avx2" = "yes"])
 
-VLC_SAVE_FLAGS
-CFLAGS="${CFLAGS} -mmmx"
-have_3dnow="no"
-AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
-void *p;
-asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
-]])
-  ], [
-    ac_cv_3dnow_inline=yes
-  ], [
-    ac_cv_3dnow_inline=no
-  ])
-])
-VLC_RESTORE_FLAGS
-AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
-  AC_DEFINE([CAN_COMPILE_3DNOW], 1,
-            [Define to 1 if 3D Now! inline assembly is available.])
-  have_3dnow="yes"
-])
-AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
-
 
 AC_ARG_ENABLE([neon],
   AS_HELP_STRING([--disable-neon],


=====================================
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_3dNOW  0x00000010
 #  define VLC_CPU_MMXEXT 0x00000020
 #  define VLC_CPU_SSE    0x00000040
 #  define VLC_CPU_SSE2   0x00000080
@@ -124,12 +123,6 @@ unsigned vlc_CPU_raw(void);
 #  define vlc_CPU_AVX2() ((vlc_CPU() & VLC_CPU_AVX2) != 0)
 # endif
 
-# ifdef __3dNOW__
-#  define vlc_CPU_3dNOW() (1)
-# else
-#  define vlc_CPU_3dNOW() ((vlc_CPU() & VLC_CPU_3dNOW) != 0)
-# endif
-
 # ifdef __XOP__
 #  define vlc_CPU_XOP() (1)
 # else


=====================================
modules/codec/libmpeg2.c
=====================================
@@ -201,8 +201,6 @@ static int OpenDecoder( vlc_object_t *p_this )
 #if defined( __i386__ ) || defined( __x86_64__ )
     if( vlc_CPU_MMX() )
         i_accel |= MPEG2_ACCEL_X86_MMX;
-    if( vlc_CPU_3dNOW() )
-        i_accel |= MPEG2_ACCEL_X86_3DNOW;
     if( vlc_CPU_MMXEXT() )
         i_accel |= MPEG2_ACCEL_X86_MMXEXT;
 #elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )


=====================================
modules/video_chroma/swscale.c
=====================================
@@ -233,8 +233,6 @@ static int GetSwsCpuMask(void)
         i_sws_cpu |= SWS_CPU_CAPS_MMX;
     if( vlc_CPU_MMXEXT() )
         i_sws_cpu |= SWS_CPU_CAPS_MMX2;
-    if( vlc_CPU_3dNOW() )
-        i_sws_cpu |= SWS_CPU_CAPS_3DNOW;
 #elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
     if( vlc_CPU_ALTIVEC() )
         i_sws_cpu |= SWS_CPU_CAPS_ALTIVEC;


=====================================
modules/video_filter/deinterlace/deinterlace.c
=====================================
@@ -570,14 +570,6 @@ notsupp:
     }
     else
 #endif
-#if defined(CAN_COMPILE_3DNOW)
-    if( pixel_size == 1 && vlc_CPU_3dNOW() )
-    {
-        p_sys->pf_merge = Merge3DNow;
-        p_sys->pf_end_merge = End3DNow;
-    }
-    else
-#endif
 #if defined(CAN_COMPILE_ARM)
     if( vlc_CPU_ARM_NEON() )
         p_sys->pf_merge = pixel_size == 1 ? merge8_arm_neon : merge16_arm_neon;


=====================================
modules/video_filter/deinterlace/merge.c
=====================================
@@ -93,32 +93,6 @@ void MergeMMXEXT( void *_p_dest, const void *_p_s1, const void *_p_s2,
 }
 #endif
 
-#if defined(CAN_COMPILE_3DNOW)
-VLC_MMX
-void Merge3DNow( void *_p_dest, const void *_p_s1, const void *_p_s2,
-                 size_t i_bytes )
-{
-    uint8_t *p_dest = _p_dest;
-    const uint8_t *p_s1 = _p_s1;
-    const uint8_t *p_s2 = _p_s2;
-
-    for( ; i_bytes >= 8; i_bytes -= 8 )
-    {
-        __asm__  __volatile__( "movq %2,%%mm1;"
-                               "pavgusb %1, %%mm1;"
-                               "movq %%mm1, %0" :"=m" (*p_dest):
-                                                 "m" (*p_s1),
-                                                 "m" (*p_s2) : "mm1" );
-        p_dest += 8;
-        p_s1 += 8;
-        p_s2 += 8;
-    }
-
-    for( ; i_bytes > 0; i_bytes-- )
-        *p_dest++ = ( *p_s1++ + *p_s2++ ) >> 1;
-}
-#endif
-
 #if defined(CAN_COMPILE_SSE)
 VLC_SSE
 void Merge8BitSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2,
@@ -255,10 +229,3 @@ void EndMMX( void )
     __asm__ __volatile__( "emms" :: );
 }
 #endif
-
-#if defined(CAN_COMPILE_3DNOW)
-void End3DNow( void )
-{
-    __asm__ __volatile__( "femms" :: );
-}
-#endif


=====================================
modules/video_filter/deinterlace/merge.h
=====================================
@@ -124,18 +124,6 @@ void MergeAltivec ( void *, const void *, const void *, size_t );
 void MergeMMXEXT  ( void *, const void *, const void *, size_t );
 #endif
 
-#if defined(CAN_COMPILE_3DNOW)
-/**
- * 3DNow routine to blend pixels from two picture lines.
- *
- * @param _p_dest Target
- * @param _p_s1 Source line A
- * @param _p_s2 Source line B
- * @param i_bytes Number of bytes to merge
- */
-void Merge3DNow   ( void *, const void *, const void *, size_t );
-#endif
-
 #if defined(CAN_COMPILE_SSE)
 /**
  * SSE2 routine to blend pixels from two picture lines.
@@ -200,17 +188,4 @@ void merge16_arm_sve(void *, const void *, const void *, size_t);
 void EndMMX       ( void );
 #endif
 
-#if defined(CAN_COMPILE_3DNOW)
-/**
- * 3DNow merge finalization routine.
- *
- * Must be called after a 3DNow merge is finished.
- * This exits 3DNow mode (by executing the "femms" instruction).
- *
- * The EndMerge() macro detects whether this is needed, and calls if it is,
- * so just use that.
- */
-void End3DNow     ( void );
-#endif
-
 #endif


=====================================
modules/video_filter/deinterlace/mmx.h
=====================================
@@ -191,12 +191,6 @@ typedef    union {
 #define    pxor_r2r(regs,regd)    mmx_r2r (pxor, regs, regd)
 
 
-/* 3DNOW extensions */
-
-#define pavgusb_m2r(var,reg)    mmx_m2r (pavgusb, var, reg)
-#define pavgusb_r2r(regs,regd)    mmx_r2r (pavgusb, regs, regd)
-
-
 /* AMD MMX extensions - also available in intel SSE */
 
 


=====================================
modules/video_filter/postproc.c
=====================================
@@ -136,8 +136,6 @@ static int OpenPostproc( filter_t *p_filter )
         i_flags |= PP_CPU_CAPS_MMX;
     if( vlc_CPU_MMXEXT() )
         i_flags |= PP_CPU_CAPS_MMX2;
-    if( vlc_CPU_3dNOW() )
-        i_flags |= PP_CPU_CAPS_3DNOW;
 #elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__)
     if( vlc_CPU_ALTIVEC() )
         i_flags |= PP_CPU_CAPS_ALTIVEC;


=====================================
src/linux/cpu.c
=====================================
@@ -96,8 +96,6 @@ unsigned vlc_CPU_raw(void)
                 core_caps |= VLC_CPU_AVX;
             if (!strcmp (cap, "avx2"))
                 core_caps |= VLC_CPU_AVX2;
-            if (!strcmp (cap, "3dnow"))
-                core_caps |= VLC_CPU_3dNOW;
             if (!strcmp (cap, "xop"))
                 core_caps |= VLC_CPU_XOP;
             if (!strcmp (cap, "fma4"))


=====================================
src/misc/cpu.c
=====================================
@@ -93,12 +93,6 @@ VLC_SSE static void SSE_test (void)
     asm volatile ("xorps %%xmm0,%%xmm0\n" : : : "xmm0", "xmm1");
 }
 #endif
-#if defined (CAN_COMPILE_3DNOW)
-VLC_MMX static void ThreeD_Now_test (void)
-{
-    asm volatile ("pfadd %%mm0,%%mm0\n" "femms\n" : : : "mm0");
-}
-#endif
 
 #if defined (CAN_COMPILE_ALTIVEC)
 static void Altivec_test (void)
@@ -214,11 +208,6 @@ VLC_WEAK unsigned vlc_CPU_raw(void)
     /* list these additional capabilities */
     cpuid( 0x80000001 );
 
-# if defined (CAN_COMPILE_3DNOW) && !defined (__3dNOW__)
-    if ((i_edx & 0x80000000) && vlc_CPU_check ("3D Now!", ThreeD_Now_test))
-# endif
-        i_capabilities |= VLC_CPU_3dNOW;
-
     if( b_amd && ( i_edx & 0x00400000 ) )
         i_capabilities |= VLC_CPU_MMXEXT;
 out:
@@ -291,8 +280,6 @@ void vlc_CPU_dump (vlc_object_t *obj)
         vlc_memstream_puts(&stream, "AVX ");
     if (vlc_CPU_AVX2())
         vlc_memstream_puts(&stream, "AVX2 ");
-    if (vlc_CPU_3dNOW())
-        vlc_memstream_puts(&stream, "3DNow! ");
     if (vlc_CPU_XOP())
         vlc_memstream_puts(&stream, "XOP ");
     if (vlc_CPU_FMA4())



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b2dc6a56857dd4e3e2b7486f47b2c7dd9a1c9139...75bca603749d8bfb7048a84ea811cbdb19447596

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b2dc6a56857dd4e3e2b7486f47b2c7dd9a1c9139...75bca603749d8bfb7048a84ea811cbdb19447596
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list