[FFmpeg-cvslog] avcodec/x86/ac3dsp_init: Remove obsolete 3dnow, MMX(EXT), SSE functions

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


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jun  7 00:55:25 2022 +0200| [fd98594a8831ce037a495b6d7e090bd8f81e83a1] | committer: Andreas Rheinhardt

avcodec/x86/ac3dsp_init: Remove obsolete 3dnow, MMX(EXT), SSE 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=fd98594a8831ce037a495b6d7e090bd8f81e83a1
---

 libavcodec/x86/ac3dsp.asm    | 61 --------------------------------------------
 libavcodec/x86/ac3dsp_init.c | 18 -------------
 2 files changed, 79 deletions(-)

diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index 4ddaa94320..c11a94ca93 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -63,14 +63,7 @@ cglobal ac3_exponent_min, 3, 4, 2, exp, reuse_blks, expn, offset
     REP_RET
 %endmacro
 
-%define LOOP_ALIGN
-INIT_MMX mmx
-AC3_EXPONENT_MIN
-%if HAVE_MMXEXT_EXTERNAL
 %define LOOP_ALIGN ALIGN 16
-INIT_MMX mmxext
-AC3_EXPONENT_MIN
-%endif
 %if HAVE_SSE2_EXTERNAL
 INIT_XMM sse2
 AC3_EXPONENT_MIN
@@ -81,60 +74,6 @@ AC3_EXPONENT_MIN
 ; void ff_float_to_fixed24(int32_t *dst, const float *src, unsigned int len)
 ;-----------------------------------------------------------------------------
 
-; The 3DNow! version is not bit-identical because pf2id uses truncation rather
-; than round-to-nearest.
-INIT_MMX 3dnow
-cglobal float_to_fixed24, 3, 3, 0, dst, src, len
-    movq   m0, [pf_1_24]
-.loop:
-    movq   m1, [srcq   ]
-    movq   m2, [srcq+8 ]
-    movq   m3, [srcq+16]
-    movq   m4, [srcq+24]
-    pfmul  m1, m0
-    pfmul  m2, m0
-    pfmul  m3, m0
-    pfmul  m4, m0
-    pf2id  m1, m1
-    pf2id  m2, m2
-    pf2id  m3, m3
-    pf2id  m4, m4
-    movq  [dstq   ], m1
-    movq  [dstq+8 ], m2
-    movq  [dstq+16], m3
-    movq  [dstq+24], m4
-    add  srcq, 32
-    add  dstq, 32
-    sub  lend, 8
-    ja .loop
-    femms
-    RET
-
-INIT_XMM sse
-cglobal float_to_fixed24, 3, 3, 3, dst, src, len
-    movaps     m0, [pf_1_24]
-.loop:
-    movaps     m1, [srcq   ]
-    movaps     m2, [srcq+16]
-    mulps      m1, m0
-    mulps      m2, m0
-    cvtps2pi  mm0, m1
-    movhlps    m1, m1
-    cvtps2pi  mm1, m1
-    cvtps2pi  mm2, m2
-    movhlps    m2, m2
-    cvtps2pi  mm3, m2
-    movq  [dstq   ], mm0
-    movq  [dstq+ 8], mm1
-    movq  [dstq+16], mm2
-    movq  [dstq+24], mm3
-    add      srcq, 32
-    add      dstq, 32
-    sub      lend, 8
-    ja .loop
-    emms
-    RET
-
 INIT_XMM sse2
 cglobal float_to_fixed24, 3, 3, 9, dst, src, len
     movaps     m0, [pf_1_24]
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 5f20e6dc31..75a341bc95 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -24,12 +24,8 @@
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/ac3dsp.h"
 
-void ff_ac3_exponent_min_mmx   (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
-void ff_ac3_exponent_min_mmxext(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
 void ff_ac3_exponent_min_sse2  (uint8_t *exp, int num_reuse_blocks, int nb_coefs);
 
-void ff_float_to_fixed24_3dnow(int32_t *dst, const float *src, unsigned int len);
-void ff_float_to_fixed24_sse  (int32_t *dst, const float *src, unsigned int len);
 void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len);
 
 int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]);
@@ -41,20 +37,6 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (EXTERNAL_MMX(cpu_flags)) {
-        c->ac3_exponent_min = ff_ac3_exponent_min_mmx;
-    }
-    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        if (!bit_exact) {
-            c->float_to_fixed24 = ff_float_to_fixed24_3dnow;
-        }
-    }
-    if (EXTERNAL_MMXEXT(cpu_flags)) {
-        c->ac3_exponent_min = ff_ac3_exponent_min_mmxext;
-    }
-    if (EXTERNAL_SSE(cpu_flags)) {
-        c->float_to_fixed24 = ff_float_to_fixed24_sse;
-    }
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->ac3_exponent_min = ff_ac3_exponent_min_sse2;
         c->float_to_fixed24 = ff_float_to_fixed24_sse2;



More information about the ffmpeg-cvslog mailing list