PR #25164 opened by michaelni URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25164 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25164.patch
MMI was simply disabled before and the code would not have compiled if it was enabled this fixes it and fate passes under qemu with this enabled (according to claude which tested that) >From dc53efc627a06b5feb85e9a3054878007f202f84 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Sat, 17 Oct 2026 00:01:44 +0200 Subject: [PATCH 1/5] avcodec/mips/vp8dsp_mmi: constify src in the ff_put_vp8_*_mmi definitions --- libavcodec/mips/vp8dsp_mmi.c | 72 ++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/libavcodec/mips/vp8dsp_mmi.c b/libavcodec/mips/vp8dsp_mmi.c index 6de405bfb5..ac8b07bca1 100644 --- a/libavcodec/mips/vp8dsp_mmi.c +++ b/libavcodec/mips/vp8dsp_mmi.c @@ -1440,7 +1440,7 @@ void ff_vp8_h_loop_filter_simple_mmi(uint8_t *dst, ptrdiff_t stride, int flim) vp8_filter_common_is4tap(dst + i * stride, 1); } -void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y) { #if 1 @@ -1487,7 +1487,7 @@ void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y) { #if 1 @@ -1527,7 +1527,7 @@ void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int x, int y) { #if 1 @@ -1567,7 +1567,7 @@ void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -1652,7 +1652,7 @@ void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -1722,7 +1722,7 @@ void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -1785,7 +1785,7 @@ void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -1875,7 +1875,7 @@ void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -1949,7 +1949,7 @@ void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2017,7 +2017,7 @@ void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2103,7 +2103,7 @@ void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2174,7 +2174,7 @@ void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2239,7 +2239,7 @@ void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2330,7 +2330,7 @@ void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2406,7 +2406,7 @@ void ff_put_vp8_epel8_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2476,7 +2476,7 @@ void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2515,7 +2515,7 @@ void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2554,7 +2554,7 @@ void ff_put_vp8_epel8_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2592,7 +2592,7 @@ void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2631,7 +2631,7 @@ void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2670,7 +2670,7 @@ void ff_put_vp8_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2709,7 +2709,7 @@ void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2748,7 +2748,7 @@ void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2787,7 +2787,7 @@ void ff_put_vp8_epel8_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2826,7 +2826,7 @@ void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2865,7 +2865,7 @@ void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2904,7 +2904,7 @@ void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, +void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) { #if 1 @@ -2943,7 +2943,7 @@ void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, #endif } -void ff_put_vp8_bilinear16_h_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear16_h_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3021,7 +3021,7 @@ void ff_put_vp8_bilinear16_h_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear16_v_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear16_v_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3091,7 +3091,7 @@ void ff_put_vp8_bilinear16_v_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear16_hv_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear16_hv_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3125,7 +3125,7 @@ void ff_put_vp8_bilinear16_hv_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear8_h_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear8_h_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3187,7 +3187,7 @@ void ff_put_vp8_bilinear8_h_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear8_v_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear8_v_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3251,7 +3251,7 @@ void ff_put_vp8_bilinear8_v_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear8_hv_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear8_hv_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3285,7 +3285,7 @@ void ff_put_vp8_bilinear8_hv_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear4_h_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear4_h_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3344,7 +3344,7 @@ void ff_put_vp8_bilinear4_h_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 @@ -3405,7 +3405,7 @@ void ff_put_vp8_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, #endif } -void ff_put_vp8_bilinear4_hv_mmi(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, +void ff_put_vp8_bilinear4_hv_mmi(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { #if 1 -- 2.54.0 >From 79c6b5c83061d3d657a1ac0288c12d71232615a4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Sat, 17 Oct 2026 00:01:44 +0200 Subject: [PATCH 2/5] avcodec/mips/mpegvideo_mmi: include avassert.h for av_assert2() --- libavcodec/mips/mpegvideo_mmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mips/mpegvideo_mmi.c b/libavcodec/mips/mpegvideo_mmi.c index 31c028025a..485c247ced 100644 --- a/libavcodec/mips/mpegvideo_mmi.c +++ b/libavcodec/mips/mpegvideo_mmi.c @@ -23,6 +23,7 @@ */ #include "mpegvideo_mips.h" +#include "libavutil/avassert.h" #include "libavutil/mips/mmiutils.h" void ff_dct_unquantize_h263_intra_mmi(const MPVContext *s, int16_t *block, -- 2.54.0 >From f9872e7c1e70b6d06d4ec4d597e7e99ef6409503 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Sun, 18 Oct 2026 03:30:50 +0200 Subject: [PATCH 3/5] avcodec/mips/mpegvideo_mmi: use av_assert2() for the remaining assert() --- libavcodec/mips/mpegvideo_mmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mips/mpegvideo_mmi.c b/libavcodec/mips/mpegvideo_mmi.c index 485c247ced..292b725025 100644 --- a/libavcodec/mips/mpegvideo_mmi.c +++ b/libavcodec/mips/mpegvideo_mmi.c @@ -355,7 +355,7 @@ void ff_dct_unquantize_mpeg2_intra_mmi(const MPVContext *s, int16_t *block, DECLARE_VAR_ALL64; DECLARE_VAR_ADDRT; - assert(s->block_last_index[n]>=0); + av_assert2(s->block_last_index[n]>=0); nCoeffs = s->intra_scantable.raster_end[s->block_last_index[n]]; -- 2.54.0 >From 79c5358eeaba993bf8626cf75288a11dfd09d4af Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Sat, 17 Oct 2026 00:09:10 +0200 Subject: [PATCH 4/5] avcodec/mips/Makefile: build mpegvideoencdsp_mmi.o under its current name The source was renamed from mpegvideoenc_mmi.c when denoise_dct moved to MpegvideoEncDSPContext, the MMI object list still had the old name. --- libavcodec/mips/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile index 71c109764a..88ede7cc93 100644 --- a/libavcodec/mips/Makefile +++ b/libavcodec/mips/Makefile @@ -98,7 +98,7 @@ MMI-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_mmi.o MMI-OBJS-$(CONFIG_H264CHROMA) += mips/h264chroma_mmi.o MMI-OBJS-$(CONFIG_H264PRED) += mips/h264pred_mmi.o MMI-OBJS-$(CONFIG_MPEGVIDEO) += mips/mpegvideo_mmi.o -MMI-OBJS-$(CONFIG_MPEGVIDEOENCDSP) += mips/mpegvideoenc_mmi.o +MMI-OBJS-$(CONFIG_MPEGVIDEOENCDSP) += mips/mpegvideoencdsp_mmi.o MMI-OBJS-$(CONFIG_IDCTDSP) += mips/idctdsp_mmi.o \ mips/simple_idct_mmi.o MMI-OBJS-$(CONFIG_MPEG4_DECODER) += mips/xvid_idct_mmi.o -- 2.54.0 >From e97375c168facaba044342f4c22fd14c1f0b788c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Sun, 18 Oct 2026 04:28:30 +0200 Subject: [PATCH 5/5] avutil/mips/mmiutils: provide the Loongson MMI mnemonics GNU binutils lacks GNU binutils spells the MMI instructions pxor, pand, por, pnor, ssrld and sslld as xor, and, or, nor, dsrl and dsll on floating point registers, with -march=loongson2e/2f/3a and since 2.32 with -mloongson-mmi; the p-named entries in its opcode table are the R5900 instructions on general purpose registers. The other 43 p-named MMI instructions FFmpeg uses are spelled the same by everyone. Loongson's gcc toolchain accepts both spellings (ebedd26eef), the binutils 2.24 of their cross-gcc-4.9.3-n64-loongson-rc6.1 only the GNU ones. Since 903c5d58f0 configure probes pxor and so silently disables MMI with every GNU binutils. Probe Loongson's spelling first and fall back to the GNU one together with assembler macros that define the six names, as asmdefs.h already does for parse_r. The macros assemble to the same encodings as the GNU spelling with binutils 2.24, 2.28 and 2.42. --- configure | 4 +++- libavutil/mips/mmiutils.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure b/configure index c97ddb186f..e414fc59c6 100755 --- a/configure +++ b/configure @@ -2596,6 +2596,7 @@ TOOLCHAIN_FEATURES=" ibm_asm inline_asm_direct_symbol_refs inline_asm_nonlocal_labels + loongson_mmi_mnemonics pragma_deprecated rsync_contimeout symver_asm_label @@ -6652,7 +6653,8 @@ elif enabled mips; then enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext' # MMI can be detected at runtime too - enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi' + enabled mmi && { check_inline_asm loongson_mmi_mnemonics '"pxor $f0, $f0, $f0\n\tssrld $f0, $f0, $f0"' '-mloongson-mmi' || + check_inline_asm mmi '"xor $f0, $f0, $f0"' '-mloongson-mmi'; } && append MMIFLAGS '-mloongson-mmi' if enabled bigendian && enabled msa; then disable msa diff --git a/libavutil/mips/mmiutils.h b/libavutil/mips/mmiutils.h index 7991e14e84..47cdb19f1c 100644 --- a/libavutil/mips/mmiutils.h +++ b/libavutil/mips/mmiutils.h @@ -29,6 +29,16 @@ #include "libavutil/mem_internal.h" #include "libavutil/mips/asmdefs.h" +#if !HAVE_LOONGSON_MMI_MNEMONICS +/* GNU binutils lacks Loongson's names for these MMI instructions */ +__asm__(".macro pxor d, s, t\n\txor \\d, \\s, \\t\n\t.endm\n" + ".macro pand d, s, t\n\tand \\d, \\s, \\t\n\t.endm\n" + ".macro por d, s, t\n\tor \\d, \\s, \\t\n\t.endm\n" + ".macro pnor d, s, t\n\tnor \\d, \\s, \\t\n\t.endm\n" + ".macro ssrld d, s, t\n\tdsrl \\d, \\s, \\t\n\t.endm\n" + ".macro sslld d, s, t\n\tdsll \\d, \\s, \\t\n\t.endm\n"); +#endif + /* * These were used to define temporary registers for MMI marcos * however now we're using $at. They're theoretically unnecessary -- 2.54.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
