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 SSE
specific implementation) at compile-time for x64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>
---
 libavcodec/x86/blockdsp.asm    | 4 ++++
 libavcodec/x86/blockdsp_init.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/libavcodec/x86/blockdsp.asm b/libavcodec/x86/blockdsp.asm
index 9d203df8f5..dfa38f1d3d 100644
--- a/libavcodec/x86/blockdsp.asm
+++ b/libavcodec/x86/blockdsp.asm
@@ -46,9 +46,11 @@ cglobal clear_block, 1, 1, %1, blocks
     RET
 %endmacro
 
+%if ARCH_X86_32
 INIT_MMX mmx
 %define ZERO pxor
 CLEAR_BLOCK 0, 4
+%endif
 INIT_XMM sse
 %define ZERO xorps
 CLEAR_BLOCK 1, 2
@@ -78,9 +80,11 @@ cglobal clear_blocks, 1, 2, %1, blocks, len
     RET
 %endmacro
 
+%if ARCH_X86_32
 INIT_MMX mmx
 %define ZERO pxor
 CLEAR_BLOCKS 0
+%endif
 INIT_XMM sse
 %define ZERO xorps
 CLEAR_BLOCKS 1
diff --git a/libavcodec/x86/blockdsp_init.c b/libavcodec/x86/blockdsp_init.c
index d7f8a8e508..3b857a51b6 100644
--- a/libavcodec/x86/blockdsp_init.c
+++ b/libavcodec/x86/blockdsp_init.c
@@ -37,10 +37,12 @@ av_cold void ff_blockdsp_init_x86(BlockDSPContext *c,
 #if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
+#if ARCH_X86_32
     if (EXTERNAL_MMX(cpu_flags)) {
         c->clear_block  = ff_clear_block_mmx;
         c->clear_blocks = ff_clear_blocks_mmx;
     }
+#endif
 
     if (EXTERNAL_SSE(cpu_flags)) {
         c->clear_block  = ff_clear_block_sse;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to