From 3d716d38abdae1982e84e30becb57458244656bd Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 7 Jun 2022 01:22:52 +0200 Subject: [PATCH] avcodec/x86/audiodsp_init: Remove obsolete MMX(EXT) 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 --- libavcodec/x86/audiodsp.asm | 13 +------------ libavcodec/x86/audiodsp_init.c | 10 ---------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/libavcodec/x86/audiodsp.asm b/libavcodec/x86/audiodsp.asm index de395e5fa8..b604b0443c 100644 --- a/libavcodec/x86/audiodsp.asm +++ b/libavcodec/x86/audiodsp.asm @@ -23,8 +23,8 @@ SECTION .text -%macro SCALARPRODUCT 0 ; int ff_scalarproduct_int16(int16_t *v1, int16_t *v2, int order) +INIT_XMM sse2 cglobal scalarproduct_int16, 3,3,3, v1, v2, order add orderd, orderd add v1q, orderq @@ -42,16 +42,7 @@ cglobal scalarproduct_int16, 3,3,3, v1, v2, order jl .loop HADDD m2, m0 movd eax, m2 -%if mmsize == 8 - emms -%endif RET -%endmacro - -INIT_MMX mmxext -SCALARPRODUCT -INIT_XMM sse2 -SCALARPRODUCT ;----------------------------------------------------------------------------- @@ -117,8 +108,6 @@ cglobal vector_clip_int32%5, 5,5,%1, dst, src, min, max, len REP_RET %endmacro -INIT_MMX mmx -VECTOR_CLIP_INT32 0, 1, 0, 0 INIT_XMM sse2 VECTOR_CLIP_INT32 6, 1, 0, 0, _int VECTOR_CLIP_INT32 6, 2, 0, 1 diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c index 98e296c264..aa5e43e570 100644 --- a/libavcodec/x86/audiodsp_init.c +++ b/libavcodec/x86/audiodsp_init.c @@ -24,13 +24,9 @@ #include "libavutil/x86/cpu.h" #include "libavcodec/audiodsp.h" -int32_t ff_scalarproduct_int16_mmxext(const int16_t *v1, const int16_t *v2, - int order); int32_t ff_scalarproduct_int16_sse2(const int16_t *v1, const int16_t *v2, int order); -void ff_vector_clip_int32_mmx(int32_t *dst, const int32_t *src, - int32_t min, int32_t max, unsigned int len); void ff_vector_clip_int32_sse2(int32_t *dst, const int32_t *src, int32_t min, int32_t max, unsigned int len); void ff_vector_clip_int32_int_sse2(int32_t *dst, const int32_t *src, @@ -44,12 +40,6 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c) { int cpu_flags = av_get_cpu_flags(); - if (EXTERNAL_MMX(cpu_flags)) - c->vector_clip_int32 = ff_vector_clip_int32_mmx; - - if (EXTERNAL_MMXEXT(cpu_flags)) - c->scalarproduct_int16 = ff_scalarproduct_int16_mmxext; - if (EXTERNAL_SSE(cpu_flags)) c->vector_clipf = ff_vector_clipf_sse;