[FFmpeg-cvslog] avcodec/x86/videodsp: Remove obsolete MMX, 3dnow, SSE functions
Andreas Rheinhardt
git at videolan.org
Wed Jun 22 15:29:23 EEST 2022
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Jun 12 02:13:39 2022 +0200| [19abc4c0a9ee5e45b630d7ca9815e8d0723a24e2] | committer: Andreas Rheinhardt
avcodec/x86/videodsp: Remove obsolete MMX, 3dnow, SSE functions
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). So given that the only systems which benefit
from these functions are truely ancient 32bit x86s they are removed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19abc4c0a9ee5e45b630d7ca9815e8d0723a24e2
---
libavcodec/x86/videodsp.asm | 38 ++--------------------
libavcodec/x86/videodsp_init.c | 71 ------------------------------------------
2 files changed, 3 insertions(+), 106 deletions(-)
diff --git a/libavcodec/x86/videodsp.asm b/libavcodec/x86/videodsp.asm
index e237860700..b19a8300c5 100644
--- a/libavcodec/x86/videodsp.asm
+++ b/libavcodec/x86/videodsp.asm
@@ -45,7 +45,6 @@ SECTION .text
jnz .%1_y_loop
%endmacro
-%macro vvar_fn 0
; .----. <- zero
; | | <- top is copied from first line in body of source
; |----| <- start_y
@@ -53,6 +52,7 @@ SECTION .text
; |----| <- end_y
; | | <- bottom is copied from last line in body of source
; '----' <- bh
+INIT_XMM sse
%if ARCH_X86_64
cglobal emu_edge_vvar, 7, 8, 1, dst, dst_stride, src, src_stride, \
start_y, end_y, bh, w
@@ -81,15 +81,6 @@ cglobal emu_edge_vvar, 1, 6, 1, dst, src, start_y, end_y, bh, w
V_COPY_ROW bottom, bhq ; v_copy_row(bottom, bh)
.end: ; }
RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-vvar_fn
-%endif
-
-INIT_XMM sse
-vvar_fn
%macro hvar_fn 0
cglobal emu_edge_hvar, 5, 6, 1, dst, dst_stride, start_x, n_words, h, w
@@ -105,11 +96,7 @@ cglobal emu_edge_hvar, 5, 6, 1, dst, dst_stride, start_x, n_words, h, w
imul wd, 0x01010101 ; w *= 0x01010101
movd m0, wd
mov wq, n_wordsq ; initialize w
-%if cpuflag(sse2)
pshufd m0, m0, q0000 ; splat
-%else ; mmx
- punpckldq m0, m0 ; splat
-%endif ; mmx/sse
%endif ; avx2
.x_loop: ; do {
movu [dstq+wq*2], m0 ; write($reg, $mmsize)
@@ -123,11 +110,6 @@ cglobal emu_edge_hvar, 5, 6, 1, dst, dst_stride, start_x, n_words, h, w
RET
%endmacro
-%if ARCH_X86_32
-INIT_MMX mmx
-hvar_fn
-%endif
-
INIT_XMM sse2
hvar_fn
@@ -338,9 +320,6 @@ cglobal emu_edge_vfix %+ %%n, 1, 5, 1, dst, src, start_y, end_y, bh
INIT_MMX mmx
VERTICAL_EXTEND 1, 15
-%if ARCH_X86_32
-VERTICAL_EXTEND 16, 22
-%endif
INIT_XMM sse
VERTICAL_EXTEND 16, 22
@@ -438,9 +417,6 @@ cglobal emu_edge_hfix %+ %%n, 4, 5, 1, dst, dst_stride, start_x, bh, val
INIT_MMX mmx
H_EXTEND 2, 14
-%if ARCH_X86_32
-H_EXTEND 16, 22
-%endif
INIT_XMM sse2
H_EXTEND 16, 22
@@ -450,19 +426,11 @@ INIT_XMM avx2
H_EXTEND 8, 22
%endif
-%macro PREFETCH_FN 1
+INIT_MMX mmxext
cglobal prefetch, 3, 3, 0, buf, stride, h
.loop:
- %1 [bufq]
+ prefetcht0 [bufq]
add bufq, strideq
dec hd
jg .loop
REP_RET
-%endmacro
-
-INIT_MMX mmxext
-PREFETCH_FN prefetcht0
-%if ARCH_X86_32
-INIT_MMX 3dnow
-PREFETCH_FN prefetch
-%endif
diff --git a/libavcodec/x86/videodsp_init.c b/libavcodec/x86/videodsp_init.c
index 961424aa13..a14c9635fb 100644
--- a/libavcodec/x86/videodsp_init.c
+++ b/libavcodec/x86/videodsp_init.c
@@ -52,26 +52,6 @@ extern emu_edge_vfix_func ff_emu_edge_vfix12_mmx;
extern emu_edge_vfix_func ff_emu_edge_vfix13_mmx;
extern emu_edge_vfix_func ff_emu_edge_vfix14_mmx;
extern emu_edge_vfix_func ff_emu_edge_vfix15_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix16_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix17_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix18_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix19_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix20_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix21_mmx;
-extern emu_edge_vfix_func ff_emu_edge_vfix22_mmx;
-#if ARCH_X86_32
-static emu_edge_vfix_func * const vfixtbl_mmx[22] = {
- &ff_emu_edge_vfix1_mmx, &ff_emu_edge_vfix2_mmx, &ff_emu_edge_vfix3_mmx,
- &ff_emu_edge_vfix4_mmx, &ff_emu_edge_vfix5_mmx, &ff_emu_edge_vfix6_mmx,
- &ff_emu_edge_vfix7_mmx, &ff_emu_edge_vfix8_mmx, &ff_emu_edge_vfix9_mmx,
- &ff_emu_edge_vfix10_mmx, &ff_emu_edge_vfix11_mmx, &ff_emu_edge_vfix12_mmx,
- &ff_emu_edge_vfix13_mmx, &ff_emu_edge_vfix14_mmx, &ff_emu_edge_vfix15_mmx,
- &ff_emu_edge_vfix16_mmx, &ff_emu_edge_vfix17_mmx, &ff_emu_edge_vfix18_mmx,
- &ff_emu_edge_vfix19_mmx, &ff_emu_edge_vfix20_mmx, &ff_emu_edge_vfix21_mmx,
- &ff_emu_edge_vfix22_mmx
-};
-#endif
-extern emu_edge_vvar_func ff_emu_edge_vvar_mmx;
extern emu_edge_vfix_func ff_emu_edge_vfix16_sse;
extern emu_edge_vfix_func ff_emu_edge_vfix17_sse;
extern emu_edge_vfix_func ff_emu_edge_vfix18_sse;
@@ -103,19 +83,6 @@ extern emu_edge_hfix_func ff_emu_edge_hfix8_mmx;
extern emu_edge_hfix_func ff_emu_edge_hfix10_mmx;
extern emu_edge_hfix_func ff_emu_edge_hfix12_mmx;
extern emu_edge_hfix_func ff_emu_edge_hfix14_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix16_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix18_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix20_mmx;
-extern emu_edge_hfix_func ff_emu_edge_hfix22_mmx;
-#if ARCH_X86_32
-static emu_edge_hfix_func * const hfixtbl_mmx[11] = {
- ff_emu_edge_hfix2_mmx, ff_emu_edge_hfix4_mmx, ff_emu_edge_hfix6_mmx,
- ff_emu_edge_hfix8_mmx, ff_emu_edge_hfix10_mmx, ff_emu_edge_hfix12_mmx,
- ff_emu_edge_hfix14_mmx, ff_emu_edge_hfix16_mmx, ff_emu_edge_hfix18_mmx,
- ff_emu_edge_hfix20_mmx, ff_emu_edge_hfix22_mmx
-};
-#endif
-extern emu_edge_hvar_func ff_emu_edge_hvar_mmx;
extern emu_edge_hfix_func ff_emu_edge_hfix16_sse2;
extern emu_edge_hfix_func ff_emu_edge_hfix18_sse2;
extern emu_edge_hfix_func ff_emu_edge_hfix20_sse2;
@@ -221,30 +188,6 @@ static av_always_inline void emulated_edge_mc(uint8_t *dst, const uint8_t *src,
}
}
-#if ARCH_X86_32
-static av_noinline void emulated_edge_mc_mmx(uint8_t *buf, const uint8_t *src,
- ptrdiff_t buf_stride,
- ptrdiff_t src_stride,
- int block_w, int block_h,
- int src_x, int src_y, int w, int h)
-{
- emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
- src_x, src_y, w, h, vfixtbl_mmx, &ff_emu_edge_vvar_mmx,
- hfixtbl_mmx, &ff_emu_edge_hvar_mmx);
-}
-
-static av_noinline void emulated_edge_mc_sse(uint8_t *buf, const uint8_t *src,
- ptrdiff_t buf_stride,
- ptrdiff_t src_stride,
- int block_w, int block_h,
- int src_x, int src_y, int w, int h)
-{
- emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h,
- src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse,
- hfixtbl_mmx, &ff_emu_edge_hvar_mmx);
-}
-#endif
-
static av_noinline void emulated_edge_mc_sse2(uint8_t *buf, const uint8_t *src,
ptrdiff_t buf_stride,
ptrdiff_t src_stride,
@@ -273,29 +216,15 @@ static av_noinline void emulated_edge_mc_avx2(uint8_t *buf, const uint8_t *src,
#endif /* HAVE_X86ASM */
void ff_prefetch_mmxext(uint8_t *buf, ptrdiff_t stride, int h);
-void ff_prefetch_3dnow(uint8_t *buf, ptrdiff_t stride, int h);
av_cold void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc)
{
#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();
-#if ARCH_X86_32
- if (EXTERNAL_MMX(cpu_flags) && bpc <= 8) {
- ctx->emulated_edge_mc = emulated_edge_mc_mmx;
- }
- if (EXTERNAL_AMD3DNOW(cpu_flags)) {
- ctx->prefetch = ff_prefetch_3dnow;
- }
-#endif /* ARCH_X86_32 */
if (EXTERNAL_MMXEXT(cpu_flags)) {
ctx->prefetch = ff_prefetch_mmxext;
}
-#if ARCH_X86_32
- if (EXTERNAL_SSE(cpu_flags) && bpc <= 8) {
- ctx->emulated_edge_mc = emulated_edge_mc_sse;
- }
-#endif /* ARCH_X86_32 */
if (EXTERNAL_SSE2(cpu_flags) && bpc <= 8) {
ctx->emulated_edge_mc = emulated_edge_mc_sse2;
}
More information about the ffmpeg-cvslog
mailing list