diff mbox series

[FFmpeg-devel,35/41] swresample/x86/audio_convert_init: Disable overridden functions on x64

Message ID DB6PR0101MB221451110A5DEB2151C7F64B8FA79@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Superseded
Headers show
Series Stop including superseded functions for x64 | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt June 9, 2022, 11:55 p.m. UTC
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). This commit therefore disables
the MMX implementation (which is overridden by the SSE2
specific implementation) at compile-time for x64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libswresample/x86/audio_convert.asm    | 2 ++
 libswresample/x86/audio_convert_init.c | 4 ++++
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm
index d441636d3c..d2413f9f04 100644
--- a/libswresample/x86/audio_convert.asm
+++ b/libswresample/x86/audio_convert.asm
@@ -608,6 +608,7 @@  pack_8ch_%2_to_%1_u_int %+ SUFFIX:
 %macro NOP_N 0-6
 %endmacro
 
+%if ARCH_X86_32
 INIT_MMX mmx
 CONV int32, int16, u, 2, 1, INT16_TO_INT32_N, NOP_N
 CONV int32, int16, a, 2, 1, INT16_TO_INT32_N, NOP_N
@@ -616,6 +617,7 @@  CONV int16, int32, a, 1, 2, INT32_TO_INT16_N, NOP_N
 
 PACK_6CH float, float, u, 2, 2, 0, NOP_N, NOP_N
 PACK_6CH float, float, a, 2, 2, 0, NOP_N, NOP_N
+%endif
 
 INIT_XMM sse
 PACK_6CH float, float, u, 2, 2, 7, NOP_N, NOP_N
diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c
index a7d5ab89f8..7728c9ae00 100644
--- a/libswresample/x86/audio_convert_init.c
+++ b/libswresample/x86/audio_convert_init.c
@@ -52,15 +52,19 @@  av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
             ac->simd_f =  ff_int32_to_int16_a_ ## cap;\
     }
 
+#if ARCH_X86_32
 MULTI_CAPS_FUNC(MMX, mmx)
+#endif
 MULTI_CAPS_FUNC(SSE2, sse2)
 
+#if ARCH_X86_32
     if(EXTERNAL_MMX(mm_flags)) {
         if(channels == 6) {
             if(   out_fmt == AV_SAMPLE_FMT_FLT  && in_fmt == AV_SAMPLE_FMT_FLTP || out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_S32P)
                 ac->simd_f =  ff_pack_6ch_float_to_float_a_mmx;
         }
     }
+#endif
     if(EXTERNAL_SSE(mm_flags)) {
         if(channels == 6) {
             if(   out_fmt == AV_SAMPLE_FMT_FLT  && in_fmt == AV_SAMPLE_FMT_FLTP || out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_S32P)