diff mbox series

[FFmpeg-devel,27/41] avcodec/x86/lossless_audiodsp_init: Disable overridden functions on x64

Message ID DB6PR0101MB221461946245A8C2B80AF4678FA79@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>
---
 libavcodec/x86/lossless_audiodsp.asm    | 2 ++
 libavcodec/x86/lossless_audiodsp_init.c | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/x86/lossless_audiodsp.asm b/libavcodec/x86/lossless_audiodsp.asm
index 063d7b41af..ad8a34531a 100644
--- a/libavcodec/x86/lossless_audiodsp.asm
+++ b/libavcodec/x86/lossless_audiodsp.asm
@@ -63,8 +63,10 @@  cglobal scalarproduct_and_madd_int16, 4,4,8, v1, v2, v3, order, mul
     RET
 %endmacro
 
+%if ARCH_X86_32
 INIT_MMX mmxext
 SCALARPRODUCT
+%endif
 INIT_XMM sse2
 SCALARPRODUCT
 
diff --git a/libavcodec/x86/lossless_audiodsp_init.c b/libavcodec/x86/lossless_audiodsp_init.c
index f74c7e4361..f90cab55d3 100644
--- a/libavcodec/x86/lossless_audiodsp_init.c
+++ b/libavcodec/x86/lossless_audiodsp_init.c
@@ -40,8 +40,10 @@  av_cold void ff_llauddsp_init_x86(LLAudDSPContext *c)
 #if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
+#if ARCH_X86_32
     if (EXTERNAL_MMXEXT(cpu_flags))
         c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_mmxext;
+#endif
 
     if (EXTERNAL_SSE2(cpu_flags))
         c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_sse2;