[FFmpeg-cvslog] avcodec/x86/mpegvideoencdsp: Remove obsolete MMX(EXT) functions

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


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Jun 11 04:09:24 2022 +0200| [55d8618a4772513125678c9098fa6ca77dfdb3c3] | committer: Andreas Rheinhardt

avcodec/x86/mpegvideoencdsp: Remove obsolete MMX(EXT) functions

x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2) for x64. So given that the only systems that
benefit from these functions 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=55d8618a4772513125678c9098fa6ca77dfdb3c3
---

 libavcodec/x86/mpegvideoencdsp.asm    | 49 ++---------------------------------
 libavcodec/x86/mpegvideoencdsp_init.c | 14 ----------
 2 files changed, 2 insertions(+), 61 deletions(-)

diff --git a/libavcodec/x86/mpegvideoencdsp.asm b/libavcodec/x86/mpegvideoencdsp.asm
index aec73f82dc..e3d88f01c4 100644
--- a/libavcodec/x86/mpegvideoencdsp.asm
+++ b/libavcodec/x86/mpegvideoencdsp.asm
@@ -23,21 +23,15 @@
 
 %include "libavutil/x86/x86util.asm"
 
-SECTION_RODATA
-
-cextern pw_1
-
 SECTION .text
-; int ff_pix_sum16_mmx(uint8_t *pix, int line_size)
+; int ff_pix_sum16(uint8_t *pix, int line_size)
 ; %1 = number of loops
 ; %2 = number of GPRs used
 %macro PIX_SUM16 3
 cglobal pix_sum16, 2, %2, 6
     movsxdifnidn r1, r1d
     mov          r2, %1
-%if mmsize == 16
     lea          r3, [r1*3]
-%endif
 %if notcpuflag(xop)
     pxor         m5, m5
 %endif
@@ -50,56 +44,27 @@ cglobal pix_sum16, 2, %2, 6
     vphaddubq    m3, [r0+r3]
 %else
     mova         m0, [r0]
-%if mmsize == 8
-    mova         m1, [r0+8]
-%if cpuflag(mmxext)
-    mova         m2, [r0+r1]
-    mova         m3, [r0+r1+8]
-%endif
-%else ; sse2
     mova         m1, [r0+r1]
     mova         m2, [r0+r1*2]
     mova         m3, [r0+r3]
-%endif
-%if cpuflag(mmxext)
     psadbw       m0, m5
     psadbw       m1, m5
     psadbw       m2, m5
     psadbw       m3, m5
-%else ; mmx
-    punpckhbw    m2, m0, m5
-    punpcklbw    m0, m5
-    punpckhbw    m3, m1, m5
-    punpcklbw    m1, m5
-%endif ; cpuflag(mmxext)
 %endif ; cpuflag(xop)
     paddw        m1, m0
     paddw        m3, m2
     paddw        m3, m1
     paddw        m4, m3
-%if cpuflag(mmxext)
     lea          r0, [r0+r1*%3]
-%else
-    add          r0, r1
-%endif
     dec r2
     jne .loop
-%if mmsize == 16
     pshufd       m0, m4, q0032
     paddd        m4, m0
-%elif notcpuflag(mmxext)
-    HADDW        m4, m5
-%endif
     movd        eax, m4
     RET
 %endmacro
 
-%if ARCH_X86_32
-INIT_MMX mmx
-PIX_SUM16 16, 3, 0
-INIT_MMX mmxext
-PIX_SUM16  8, 4, 2
-%endif
 INIT_XMM sse2
 PIX_SUM16  4, 4, 4
 %if HAVE_XOP_EXTERNAL
@@ -107,7 +72,7 @@ INIT_XMM xop
 PIX_SUM16  4, 4, 4
 %endif
 
-; int ff_pix_norm1_mmx(uint8_t *pix, int line_size)
+; int ff_pix_norm1(uint8_t *pix, int line_size)
 ; %1 = number of xmm registers used
 ; %2 = number of loops
 %macro PIX_NORM1 2
@@ -118,11 +83,7 @@ cglobal pix_norm1, 2, 3, %1
     pxor         m5, m5
 .loop:
     mova         m2, [r0+0]
-%if mmsize == 8
-    mova         m3, [r0+8]
-%else
     mova         m3, [r0+r1]
-%endif
     punpckhbw    m1, m2, m0
     punpcklbw    m2, m0
     punpckhbw    m4, m3, m0
@@ -135,11 +96,7 @@ cglobal pix_norm1, 2, 3, %1
     paddd        m4, m3
     paddd        m5, m2
     paddd        m5, m4
-%if mmsize == 8
-    add          r0, r1
-%else
     lea          r0, [r0+r1*2]
-%endif
     dec r2
     jne .loop
     HADDD        m5, m1
@@ -147,8 +104,6 @@ cglobal pix_norm1, 2, 3, %1
     RET
 %endmacro
 
-INIT_MMX mmx
-PIX_NORM1 0, 16
 INIT_XMM sse2
 PIX_NORM1 6, 8
 
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c
index 532836cec9..b9c80b5382 100644
--- a/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/libavcodec/x86/mpegvideoencdsp_init.c
@@ -23,11 +23,8 @@
 #include "libavcodec/avcodec.h"
 #include "libavcodec/mpegvideoencdsp.h"
 
-int ff_pix_sum16_mmx(uint8_t *pix, int line_size);
-int ff_pix_sum16_mmxext(uint8_t *pix, int line_size);
 int ff_pix_sum16_sse2(uint8_t *pix, int line_size);
 int ff_pix_sum16_xop(uint8_t *pix, int line_size);
-int ff_pix_norm1_mmx(uint8_t *pix, int line_size);
 int ff_pix_norm1_sse2(uint8_t *pix, int line_size);
 
 #if HAVE_INLINE_ASM
@@ -219,17 +216,6 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if ARCH_X86_32
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->pix_sum   = ff_pix_sum16_mmx;
-        c->pix_norm1 = ff_pix_norm1_mmx;
-    }
-
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->pix_sum     = ff_pix_sum16_mmxext;
-    }
-#endif
-
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_sse2;
         c->pix_norm1   = ff_pix_norm1_sse2;



More information about the ffmpeg-cvslog mailing list