[FFmpeg-devel] [PATCH] Revert "libavcodec/mips: Fix specification of instruction name"

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Jul 21 14:02:52 EEST 2021


Jiaxun Yang:
> This reverts commit ebedd26eefe2ff4bbf5a358907c4e8e4b0d62eae.
> 
> The original commit states that "gcc supports both of them,
> clang only supports the second type", it's obviousely not ture.
> 
> Error: opcode not supported on this processor: loongson3a(mips64r2) `pxor $f3,$f3,$f3'
> 
> Tested with latest GCC11 and binutils 2.37.
> 
> The statement is not true. I guess you may have a internal toolchain modified
> for this purpose, but you're not the sole user of FFmpeg, you're breaking
> other users like Debian. Also I can't find clang with Loongson extention
> support every where.
> 
> I'm reverting this for now. If you would like to implement it, another approach
> could be make it as marco in mmiutils.h and filter it with #if define(__clang__).
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
> Cc: Jin Bo <jinbo at loongson.cn>
> Cc: yinshiyou-hf at loongson.cn
> ---
>  libavcodec/mips/blockdsp_mmi.c    |   8 +-
>  libavcodec/mips/h264chroma_mmi.c  |  50 ++++++
>  libavcodec/mips/h264dsp_mmi.c     | 288 +++++++++++++++---------------
>  libavcodec/mips/h264pred_mmi.c    |  18 +-
>  libavcodec/mips/h264qpel_mmi.c    |  26 +--
>  libavcodec/mips/hevcdsp_mmi.c     |  32 ++--
>  libavcodec/mips/hpeldsp_mmi.c     |  26 +--
>  libavcodec/mips/idctdsp_mmi.c     |   2 +-
>  libavcodec/mips/mpegvideo_mmi.c   |  94 +++++-----
>  libavcodec/mips/pixblockdsp_mmi.c |   8 +-
>  libavcodec/mips/simple_idct_mmi.c |  14 +-
>  libavcodec/mips/vc1dsp_mmi.c      |  34 ++--
>  libavcodec/mips/vp3dsp_idct_mmi.c | 132 +++++++-------
>  libavcodec/mips/vp8dsp_mmi.c      |  80 ++++-----
>  libavcodec/mips/vp9_mc_mmi.c      |  22 ++-
>  libavcodec/mips/wmv2dsp_mmi.c     |   2 +-
>  16 files changed, 453 insertions(+), 383 deletions(-)

[...]

> diff --git a/libavcodec/mips/h264chroma_mmi.c b/libavcodec/mips/h264chroma_mmi.c
> index cc2d7cb7e9..f62cf50e54 100644
> --- a/libavcodec/mips/h264chroma_mmi.c
> +++ b/libavcodec/mips/h264chroma_mmi.c
> @@ -72,7 +72,12 @@ void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>          A.i = 64 - D.i - B.i - C.i;
>  
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]           \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]           \n\t"
> +            "dli        %[tmp0],    0x06                               \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]           \n\t"
>              "pshufh     %[B],       %[B],           %[ftmp0]           \n\t"
>              "mtc1       %[tmp0],    %[ftmp9]                           \n\t"
> @@ -171,7 +176,12 @@ void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>          A.i = 64 - E.i;
>  
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]           \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]           \n\t"
> +            "dli        %[tmp0],    0x06                               \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]           \n\t"
>              "pshufh     %[E],       %[E],           %[ftmp0]           \n\t"
>              "mtc1       %[tmp0],    %[ftmp7]                           \n\t"
> @@ -218,7 +228,12 @@ void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>          A.i = 64 - E.i;
>  
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]           \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]           \n\t"
> +            "dli        %[tmp0],    0x06                               \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]           \n\t"
>              "pshufh     %[E],       %[E],           %[ftmp0]           \n\t"
>              "mtc1       %[tmp0],    %[ftmp7]                           \n\t"
> @@ -324,7 +339,12 @@ void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>          C.i = (y << 3) - D.i;
>          A.i = 64 - D.i - B.i - C.i;
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]       \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]       \n\t"
> +            "dli        %[tmp0],    0x06                           \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]       \n\t"
>              "pshufh     %[B],       %[B],           %[ftmp0]       \n\t"
>              "mtc1       %[tmp0],    %[ftmp9]                       \n\t"
> @@ -391,7 +411,12 @@ void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>          E.i = x << 3;
>          A.i = 64 - E.i;
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]       \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]       \n\t"
> +            "dli        %[tmp0],    0x06                           \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]       \n\t"
>              "pshufh     %[E],       %[E],           %[ftmp0]       \n\t"
>              "mtc1       %[tmp0],    %[ftmp7]                       \n\t"
> @@ -439,7 +464,12 @@ void ff_avg_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>          E.i = y << 3;
>          A.i = 64 - E.i;
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]       \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]       \n\t"
> +            "dli        %[tmp0],    0x06                           \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]       \n\t"
>              "pshufh     %[E],       %[E],           %[ftmp0]       \n\t"
>              "mtc1       %[tmp0],    %[ftmp7]                       \n\t"
> @@ -500,7 +530,12 @@ void ff_put_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>  
>      if (D.i) {
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +            "dli        %[tmp0],    0x06                                \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]            \n\t"
>              "pshufh     %[B],       %[B],           %[ftmp0]            \n\t"
>              "mtc1       %[tmp0],    %[ftmp7]                            \n\t"
> @@ -549,7 +584,12 @@ void ff_put_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>      } else if (E.i) {
>          const int step = C.i ? stride : 1;
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +            "dli        %[tmp0],    0x06                                \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]            \n\t"
>              "pshufh     %[E],       %[E],           %[ftmp0]            \n\t"
>              "mtc1       %[tmp0],    %[ftmp5]                            \n\t"
> @@ -621,7 +661,12 @@ void ff_avg_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>  
>      if (D.i) {
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +            "dli        %[tmp0],    0x06                                \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]            \n\t"
>              "pshufh     %[B],       %[B],           %[ftmp0]            \n\t"
>              "mtc1       %[tmp0],    %[ftmp7]                            \n\t"
> @@ -672,7 +717,12 @@ void ff_avg_h264_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
>      } else if (E.i) {
>          const int step = C.i ? stride : 1;
>          __asm__ volatile (
> +<<<<<<< HEAD
>              "pxor       %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +=======
> +            "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]            \n\t"
> +            "dli        %[tmp0],    0x06                                \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>              "pshufh     %[A],       %[A],           %[ftmp0]            \n\t"
>              "pshufh     %[E],       %[E],           %[ftmp0]            \n\t"
>              "mtc1       %[tmp0],    %[ftmp5]                            \n\t"

[...]

> diff --git a/libavcodec/mips/vp9_mc_mmi.c b/libavcodec/mips/vp9_mc_mmi.c
> index 812f7a6994..2fc2be7973 100644
> --- a/libavcodec/mips/vp9_mc_mmi.c
> +++ b/libavcodec/mips/vp9_mc_mmi.c
> @@ -82,8 +82,13 @@ static void convolve_horiz_mmi(const uint8_t *src, int32_t src_stride,
>      dst_stride -= w;
>      __asm__ volatile (
>          "move       %[tmp1],    %[width]                   \n\t"
> +<<<<<<< HEAD
>          "pxor       %[ftmp0],   %[ftmp0],    %[ftmp0]      \n\t"
>          "gsldlc1    %[filter1], 0x07(%[filter])            \n\t"
> +=======
> +        "xor        %[ftmp0],   %[ftmp0],    %[ftmp0]      \n\t"
> +        "gsldlc1    %[filter1], 0x03(%[filter])            \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>          "gsldrc1    %[filter1], 0x00(%[filter])            \n\t"
>          "gsldlc1    %[filter2], 0x0f(%[filter])            \n\t"
>          "gsldrc1    %[filter2], 0x08(%[filter])            \n\t"
> @@ -157,8 +162,13 @@ static void convolve_vert_mmi(const uint8_t *src, int32_t src_stride,
>      dst_stride -= w;
>  
>      __asm__ volatile (
> +<<<<<<< HEAD
>          "pxor       %[ftmp0],    %[ftmp0],   %[ftmp0]      \n\t"
>          "gsldlc1    %[ftmp4],    0x07(%[filter])           \n\t"
> +=======
> +        "xor        %[ftmp0],    %[ftmp0],   %[ftmp0]      \n\t"
> +        "gsldlc1    %[ftmp4],    0x03(%[filter])           \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>          "gsldrc1    %[ftmp4],    0x00(%[filter])           \n\t"
>          "gsldlc1    %[ftmp5],    0x0f(%[filter])           \n\t"
>          "gsldrc1    %[ftmp5],    0x08(%[filter])           \n\t"
> @@ -253,8 +263,13 @@ static void convolve_avg_horiz_mmi(const uint8_t *src, int32_t src_stride,
>  
>      __asm__ volatile (
>          "move       %[tmp1],    %[width]                   \n\t"
> +<<<<<<< HEAD
>          "pxor       %[ftmp0],   %[ftmp0],    %[ftmp0]      \n\t"
>          "gsldlc1    %[filter1], 0x07(%[filter])            \n\t"
> +=======
> +        "xor        %[ftmp0],   %[ftmp0],    %[ftmp0]      \n\t"
> +        "gsldlc1    %[filter1], 0x03(%[filter])            \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>          "gsldrc1    %[filter1], 0x00(%[filter])            \n\t"
>          "gsldlc1    %[filter2], 0x0f(%[filter])            \n\t"
>          "gsldrc1    %[filter2], 0x08(%[filter])            \n\t"
> @@ -339,8 +354,13 @@ static void convolve_avg_vert_mmi(const uint8_t *src, int32_t src_stride,
>      dst_stride -= w;
>  
>      __asm__ volatile (
> +<<<<<<< HEAD
>          "pxor       %[ftmp0],    %[ftmp0],   %[ftmp0]      \n\t"
>          "gsldlc1    %[ftmp4],    0x07(%[filter])           \n\t"
> +=======
> +        "xor        %[ftmp0],    %[ftmp0],   %[ftmp0]      \n\t"
> +        "gsldlc1    %[ftmp4],    0x03(%[filter])           \n\t"
> +>>>>>>> parent of ebedd26eef (libavcodec/mips: Fix specification of instruction name)
>          "gsldrc1    %[ftmp4],    0x00(%[filter])           \n\t"
>          "gsldlc1    %[ftmp5],    0x0f(%[filter])           \n\t"
>          "gsldrc1    %[ftmp5],    0x08(%[filter])           \n\t"
> @@ -444,7 +464,7 @@ static void convolve_avg_mmi(const uint8_t *src, int32_t src_stride,
>  
>      __asm__ volatile (
>          "move       %[tmp1],    %[width]                  \n\t"
> -        "pxor       %[ftmp0],   %[ftmp0],   %[ftmp0]      \n\t"
> +        "xor        %[ftmp0],   %[ftmp0],   %[ftmp0]      \n\t"
>          "li         %[tmp0],    0x10001                   \n\t"
>          "dmtc1      %[tmp0],    %[ftmp3]                  \n\t"
>          "punpcklhw  %[ftmp3],   %[ftmp3],   %[ftmp3]      \n\t"
> diff --git a/libavcodec/mips/wmv2dsp_mmi.c b/libavcodec/mips/wmv2dsp_mmi.c
> index 1a6781ae77..82e16f929b 100644
> --- a/libavcodec/mips/wmv2dsp_mmi.c
> +++ b/libavcodec/mips/wmv2dsp_mmi.c
> @@ -106,7 +106,7 @@ void ff_wmv2_idct_add_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
>          wmv2_idct_col_mmi(block + i);
>  
>      __asm__ volatile (
> -        "pxor       %[ftmp0],   %[ftmp0],   %[ftmp0]                    \n\t"
> +        "xor        %[ftmp0],   %[ftmp0],   %[ftmp0]                    \n\t"
>  
>          // low 4 loop
>          MMI_LDC1(%[ftmp1], %[block], 0x00)
> 
This revert does not apply cleanly; it contains version conflict markers.

- Andreas


More information about the ffmpeg-devel mailing list