diff mbox series

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

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

Checks

Context Check Description
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 SSE 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/fmtconvert.asm    | 4 ++++
 libavcodec/x86/fmtconvert_init.c | 2 ++
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
index 8f62a0a093..5b7578825a 100644
--- a/libavcodec/x86/fmtconvert.asm
+++ b/libavcodec/x86/fmtconvert.asm
@@ -71,8 +71,10 @@  cglobal int32_to_float_fmul_scalar, 4, 4, %1, dst, src, mul, len
     RET
 %endmacro
 
+%if ARCH_X86_32
 INIT_XMM sse
 INT32_TO_FLOAT_FMUL_SCALAR 5
+%endif
 INIT_XMM sse2
 INT32_TO_FLOAT_FMUL_SCALAR 3
 
@@ -117,8 +119,10 @@  cglobal int32_to_float_fmul_array8, 5, 5, 5, c, dst, src, mul, len
     RET
 %endmacro
 
+%if ARCH_X86_32
 INIT_XMM sse
 INT32_TO_FLOAT_FMUL_ARRAY8
+%endif
 INIT_XMM sse2
 INT32_TO_FLOAT_FMUL_ARRAY8
 
diff --git a/libavcodec/x86/fmtconvert_init.c b/libavcodec/x86/fmtconvert_init.c
index df097054e4..0883cd8a56 100644
--- a/libavcodec/x86/fmtconvert_init.c
+++ b/libavcodec/x86/fmtconvert_init.c
@@ -43,10 +43,12 @@  av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx
 #if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
+#if ARCH_X86_32
     if (EXTERNAL_SSE(cpu_flags)) {
         c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse;
         c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_sse;
     }
+#endif
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
         c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_sse2;