[FFmpeg-cvslog] avutil/x86/pixelutils: Remove obsolete MMX(EXT) functions

Andreas Rheinhardt git at videolan.org
Wed Jun 22 15:29:15 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Jun  9 17:50:53 2022 +0200| [ea043cc53ed3506775ec6239ed5f8a20718b1098] | committer: Andreas Rheinhardt

avutil/x86/pixelutils: Remove obsolete MMX(EXT) functions

x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT, SSE and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2). So given that the only systems which benefit
from the 8x8 MMX (overridden by MMXEXT) or the 16x16 MMXEXT
(overridden by SSE2) are truely ancient 32bit x86s they are removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea043cc53ed3506775ec6239ed5f8a20718b1098
---

 libavutil/x86/pixelutils.asm    | 58 -----------------------------------------
 libavutil/x86/pixelutils_init.c |  9 -------
 2 files changed, 67 deletions(-)

diff --git a/libavutil/x86/pixelutils.asm b/libavutil/x86/pixelutils.asm
index 8b45ead78b..fbe9b45971 100644
--- a/libavutil/x86/pixelutils.asm
+++ b/libavutil/x86/pixelutils.asm
@@ -25,44 +25,6 @@
 
 SECTION .text
 
-;-------------------------------------------------------------------------------
-; int ff_pixelutils_sad_8x8_mmx(const uint8_t *src1, ptrdiff_t stride1,
-;                               const uint8_t *src2, ptrdiff_t stride2);
-;-------------------------------------------------------------------------------
-INIT_MMX mmx
-cglobal pixelutils_sad_8x8, 4,4,0, src1, stride1, src2, stride2
-    pxor        m7, m7
-    pxor        m6, m6
-%rep 4
-    mova        m0, [src1q]
-    mova        m2, [src1q + stride1q]
-    mova        m1, [src2q]
-    mova        m3, [src2q + stride2q]
-    psubusb     m4, m0, m1
-    psubusb     m5, m2, m3
-    psubusb     m1, m0
-    psubusb     m3, m2
-    por         m1, m4
-    por         m3, m5
-    punpcklbw   m0, m1, m7
-    punpcklbw   m2, m3, m7
-    punpckhbw   m1, m7
-    punpckhbw   m3, m7
-    paddw       m0, m1
-    paddw       m2, m3
-    paddw       m0, m2
-    paddw       m6, m0
-    lea         src1q, [src1q + 2*stride1q]
-    lea         src2q, [src2q + 2*stride2q]
-%endrep
-    psrlq       m0, m6, 32
-    paddw       m6, m0
-    psrlq       m0, m6, 16
-    paddw       m6, m0
-    movd        eax, m6
-    movzx       eax, ax
-    RET
-
 ;-------------------------------------------------------------------------------
 ; int ff_pixelutils_sad_8x8_mmxext(const uint8_t *src1, ptrdiff_t stride1,
 ;                                  const uint8_t *src2, ptrdiff_t stride2);
@@ -83,26 +45,6 @@ cglobal pixelutils_sad_8x8, 4,4,0, src1, stride1, src2, stride2
     movd        eax, m2
     RET
 
-;-------------------------------------------------------------------------------
-; int ff_pixelutils_sad_16x16_mmxext(const uint8_t *src1, ptrdiff_t stride1,
-;                                    const uint8_t *src2, ptrdiff_t stride2);
-;-------------------------------------------------------------------------------
-INIT_MMX mmxext
-cglobal pixelutils_sad_16x16, 4,4,0, src1, stride1, src2, stride2
-    pxor        m2, m2
-%rep 16
-    mova        m0, [src1q]
-    mova        m1, [src1q + 8]
-    psadbw      m0, [src2q]
-    psadbw      m1, [src2q + 8]
-    paddw       m2, m0
-    paddw       m2, m1
-    add         src1q, stride1q
-    add         src2q, stride2q
-%endrep
-    movd        eax, m2
-    RET
-
 ;-------------------------------------------------------------------------------
 ; int ff_pixelutils_sad_16x16_sse2(const uint8_t *src1, ptrdiff_t stride1,
 ;                                  const uint8_t *src2, ptrdiff_t stride2);
diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c
index 184a3a4a9f..c3c0662414 100644
--- a/libavutil/x86/pixelutils_init.c
+++ b/libavutil/x86/pixelutils_init.c
@@ -21,13 +21,9 @@
 #include "pixelutils.h"
 #include "cpu.h"
 
-int ff_pixelutils_sad_8x8_mmx(const uint8_t *src1, ptrdiff_t stride1,
-                              const uint8_t *src2, ptrdiff_t stride2);
 int ff_pixelutils_sad_8x8_mmxext(const uint8_t *src1, ptrdiff_t stride1,
                                  const uint8_t *src2, ptrdiff_t stride2);
 
-int ff_pixelutils_sad_16x16_mmxext(const uint8_t *src1, ptrdiff_t stride1,
-                                   const uint8_t *src2, ptrdiff_t stride2);
 int ff_pixelutils_sad_16x16_sse2(const uint8_t *src1, ptrdiff_t stride1,
                                  const uint8_t *src2, ptrdiff_t stride2);
 int ff_pixelutils_sad_a_16x16_sse2(const uint8_t *src1, ptrdiff_t stride1,
@@ -53,10 +49,6 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (EXTERNAL_MMX(cpu_flags)) {
-        sad[2] = ff_pixelutils_sad_8x8_mmx;
-    }
-
     // The best way to use SSE2 would be to do 2 SADs in parallel,
     // but we'd have to modify the pixelutils API to return SIMD functions.
 
@@ -65,7 +57,6 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
     // so just use the MMX 8x8 version even when SSE2 is available.
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         sad[2] = ff_pixelutils_sad_8x8_mmxext;
-        sad[3] = ff_pixelutils_sad_16x16_mmxext;
     }
 
     if (EXTERNAL_SSE2(cpu_flags)) {



More information about the ffmpeg-cvslog mailing list