diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-06-10 20:51:41 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-06-22 13:33:54 +0200 |
commit | 92b58002776edd3a3df03c90e8a3ab24b8f987de (patch) | |
tree | f6e39ca4be94dbd26288aefa06bbaa12600a8173 | |
parent | ee551a21ddcbf81afe183d9489c534ee80f263a0 (diff) | |
download | ffmpeg-92b58002776edd3a3df03c90e8a3ab24b8f987de.tar.gz |
avcodec/x86/pixblockdsp: Remove obsolete MMX 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 <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/x86/pixblockdsp.asm | 51 | ||||
-rw-r--r-- | libavcodec/x86/pixblockdsp_init.c | 12 |
2 files changed, 3 insertions, 60 deletions
diff --git a/libavcodec/x86/pixblockdsp.asm b/libavcodec/x86/pixblockdsp.asm index 440fe29bcc..5fdd2914eb 100644 --- a/libavcodec/x86/pixblockdsp.asm +++ b/libavcodec/x86/pixblockdsp.asm @@ -25,30 +25,6 @@ SECTION .text -INIT_MMX mmx -; void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, ptrdiff_t stride) -cglobal get_pixels, 3,4 - add r0, 128 - mov r3, -128 - pxor m7, m7 -.loop: - mova m0, [r1] - mova m2, [r1+r2] - mova m1, m0 - mova m3, m2 - punpcklbw m0, m7 - punpckhbw m1, m7 - punpcklbw m2, m7 - punpckhbw m3, m7 - mova [r0+r3+ 0], m0 - mova [r0+r3+ 8], m1 - mova [r0+r3+16], m2 - mova [r0+r3+24], m3 - lea r1, [r1+r2*2] - add r3, 32 - js .loop - REP_RET - INIT_XMM sse2 cglobal get_pixels, 3, 4, 5 lea r3, [r2*3] @@ -80,9 +56,9 @@ cglobal get_pixels, 3, 4, 5 mova [r0+0x70], m3 RET -; void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, -; ptrdiff_t stride); -%macro DIFF_PIXELS 0 +; void ff_diff_pixels(int16_t *block, const uint8_t *s1, const uint8_t *s2, +; ptrdiff_t stride); +INIT_XMM sse2 cglobal diff_pixels, 4,5,5 pxor m4, m4 add r0, 128 @@ -90,39 +66,18 @@ cglobal diff_pixels, 4,5,5 .loop: movq m0, [r1] movq m2, [r2] -%if mmsize == 8 - movq m1, m0 - movq m3, m2 - punpcklbw m0, m4 - punpckhbw m1, m4 - punpcklbw m2, m4 - punpckhbw m3, m4 -%else movq m1, [r1+r3] movq m3, [r2+r3] punpcklbw m0, m4 punpcklbw m1, m4 punpcklbw m2, m4 punpcklbw m3, m4 -%endif psubw m0, m2 psubw m1, m3 mova [r0+r4+0], m0 mova [r0+r4+mmsize], m1 -%if mmsize == 8 - add r1, r3 - add r2, r3 -%else lea r1, [r1+r3*2] lea r2, [r2+r3*2] -%endif add r4, 2 * mmsize jne .loop RET -%endmacro - -INIT_MMX mmx -DIFF_PIXELS - -INIT_XMM sse2 -DIFF_PIXELS diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c index 3a5eb6959c..51f2a0033a 100644 --- a/libavcodec/x86/pixblockdsp_init.c +++ b/libavcodec/x86/pixblockdsp_init.c @@ -23,10 +23,7 @@ #include "libavutil/x86/cpu.h" #include "libavcodec/pixblockdsp.h" -void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, ptrdiff_t stride); void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, ptrdiff_t stride); -void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, - ptrdiff_t stride); void ff_diff_pixels_sse2(int16_t *block, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride); @@ -36,15 +33,6 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c, { int cpu_flags = av_get_cpu_flags(); - if (EXTERNAL_MMX(cpu_flags)) { - if (!high_bit_depth) { - c->get_pixels_unaligned = - c->get_pixels = ff_get_pixels_mmx; - } - c->diff_pixels_unaligned = - c->diff_pixels = ff_diff_pixels_mmx; - } - if (EXTERNAL_SSE2(cpu_flags)) { if (!high_bit_depth) { c->get_pixels_unaligned = |