diff mbox series

[FFmpeg-devel,v6,6/6] libavcodec: MIPS: MMI: Move sp out of the clobber list

Message ID 20200718153542.6434-7-jiaxun.yang@flygoat.com
State Accepted
Headers show
Series MIPS MSA & MMI Runtime detection support
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Jiaxun Yang July 18, 2020, 3:35 p.m. UTC
GCC complains:
warning: listing the stack pointer register ‘$29’ in a clobber
list is deprecated [-Wdeprecated]

Actually stack pointer was restored at the end of the inline assembly
so there is no reason to add it to the clobber list.

Also use $sp insted of $29 to make our intention much more clear.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 libavcodec/mips/h264dsp_mmi.c | 38 +++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mips/h264dsp_mmi.c b/libavcodec/mips/h264dsp_mmi.c
index d3bd472599..173e191c77 100644
--- a/libavcodec/mips/h264dsp_mmi.c
+++ b/libavcodec/mips/h264dsp_mmi.c
@@ -177,7 +177,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
 
     __asm__ volatile (
         "lhu        %[tmp0],    0x00(%[block])                          \n\t"
-        PTR_ADDI   "$29,        $29,            -0x20                   \n\t"
+        PTR_ADDI   "$sp,        $sp,            -0x20                   \n\t"
         PTR_ADDIU  "%[tmp0],    %[tmp0],        0x20                    \n\t"
         MMI_LDC1(%[ftmp1], %[block], 0x10)
         "sh         %[tmp0],    0x00(%[block])                          \n\t"
@@ -254,8 +254,8 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "punpckhwd  %[ftmp3],   %[ftmp6],       %[ftmp0]                \n\t"
         "punpcklwd  %[ftmp6],   %[ftmp6],       %[ftmp0]                \n\t"
         MMI_LDC1(%[ftmp0], %[block], 0x00)
-        MMI_SDC1(%[ftmp7], $29, 0x00)
-        MMI_SDC1(%[ftmp1], $29, 0x10)
+        MMI_SDC1(%[ftmp7], $sp, 0x00)
+        MMI_SDC1(%[ftmp1], $sp, 0x10)
         "dmfc1      %[tmp1],    %[ftmp6]                                \n\t"
         "dmfc1      %[tmp3],    %[ftmp3]                                \n\t"
         "punpckhhw  %[ftmp3],   %[ftmp5],       %[ftmp2]                \n\t"
@@ -266,8 +266,8 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "punpcklwd  %[ftmp5],   %[ftmp5],       %[ftmp4]                \n\t"
         "punpckhwd  %[ftmp4],   %[ftmp3],       %[ftmp2]                \n\t"
         "punpcklwd  %[ftmp3],   %[ftmp3],       %[ftmp2]                \n\t"
-        MMI_SDC1(%[ftmp5], $29, 0x08)
-        MMI_SDC1(%[ftmp0], $29, 0x18)
+        MMI_SDC1(%[ftmp5], $sp, 0x08)
+        MMI_SDC1(%[ftmp0], $sp, 0x18)
         "dmfc1      %[tmp2],    %[ftmp3]                                \n\t"
         "dmfc1      %[tmp4],    %[ftmp4]                                \n\t"
         MMI_LDC1(%[ftmp1], %[block], 0x18)
@@ -359,7 +359,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         PTR_ADDIU  "%[addr0],   %[dst],         0x04                    \n\t"
         "mov.d      %[ftmp7],   %[ftmp10]                               \n\t"
         "dmtc1      %[tmp3],    %[ftmp6]                                \n\t"
-        MMI_LDC1(%[ftmp1], $29, 0x10)
+        MMI_LDC1(%[ftmp1], $sp, 0x10)
         "dmtc1      %[tmp1],    %[ftmp3]                                \n\t"
         "mov.d      %[ftmp4],   %[ftmp1]                                \n\t"
         "psrah      %[ftmp1],   %[ftmp1],       %[ftmp8]                \n\t"
@@ -392,7 +392,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "psrah      %[ftmp0],   %[ftmp3],       %[ftmp8]                \n\t"
         "paddh      %[ftmp2],   %[ftmp2],       %[ftmp3]                \n\t"
         "psubh      %[ftmp0],   %[ftmp0],       %[ftmp7]                \n\t"
-        MMI_LDC1(%[ftmp3], $29, 0x00)
+        MMI_LDC1(%[ftmp3], $sp, 0x00)
         "dmtc1      %[tmp5],    %[ftmp7]                                \n\t"
         "paddh      %[ftmp7],   %[ftmp7],       %[ftmp3]                \n\t"
         "paddh      %[ftmp3],   %[ftmp3],       %[ftmp3]                \n\t"
@@ -414,9 +414,9 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "paddh      %[ftmp1],   %[ftmp1],       %[ftmp7]                \n\t"
         "psubh      %[ftmp3],   %[ftmp3],       %[ftmp6]                \n\t"
         "paddh      %[ftmp7],   %[ftmp7],       %[ftmp7]                \n\t"
-        MMI_SDC1(%[ftmp3], $29, 0x00)
+        MMI_SDC1(%[ftmp3], $sp, 0x00)
         "psubh      %[ftmp7],   %[ftmp7],       %[ftmp1]                \n\t"
-        MMI_SDC1(%[ftmp0], $29, 0x10)
+        MMI_SDC1(%[ftmp0], $sp, 0x10)
         "dmfc1      %[tmp1],    %[ftmp2]                                \n\t"
         "xor        %[ftmp2],   %[ftmp2],       %[ftmp2]                \n\t"
         MMI_SDC1(%[ftmp2], %[block], 0x00)
@@ -463,8 +463,8 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "packushb   %[ftmp0],   %[ftmp0],       %[ftmp2]                \n\t"
         MMI_SWC1(%[ftmp3], %[dst], 0x00)
         MMI_SWXC1(%[ftmp0], %[dst], %[stride], 0x00)
-        MMI_LDC1(%[ftmp5], $29, 0x00)
-        MMI_LDC1(%[ftmp4], $29, 0x10)
+        MMI_LDC1(%[ftmp5], $sp, 0x00)
+        MMI_LDC1(%[ftmp4], $sp, 0x10)
         "dmtc1      %[tmp1],    %[ftmp6]                                \n\t"
         PTR_ADDU   "%[dst],     %[dst],         %[stride]               \n\t"
         PTR_ADDU   "%[dst],     %[dst],         %[stride]               \n\t"
@@ -496,7 +496,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         MMI_SWXC1(%[ftmp0], %[dst], %[stride], 0x00)
         "dmtc1      %[tmp4],    %[ftmp1]                                \n\t"
         "dmtc1      %[tmp2],    %[ftmp6]                                \n\t"
-        MMI_LDC1(%[ftmp4], $29, 0x18)
+        MMI_LDC1(%[ftmp4], $sp, 0x18)
         "mov.d      %[ftmp5],   %[ftmp4]                                \n\t"
         "psrah      %[ftmp4],   %[ftmp4],       %[ftmp8]                \n\t"
         "psrah      %[ftmp7],   %[ftmp11],      %[ftmp8]                \n\t"
@@ -528,7 +528,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "psrah      %[ftmp7],   %[ftmp6],       %[ftmp8]                \n\t"
         "paddh      %[ftmp0],   %[ftmp0],       %[ftmp6]                \n\t"
         "psubh      %[ftmp7],   %[ftmp7],       %[ftmp3]                \n\t"
-        MMI_LDC1(%[ftmp6], $29, 0x08)
+        MMI_LDC1(%[ftmp6], $sp, 0x08)
         "dmtc1      %[tmp6],    %[ftmp3]                                \n\t"
         "paddh      %[ftmp3],   %[ftmp3],       %[ftmp6]                \n\t"
         "paddh      %[ftmp6],   %[ftmp6],       %[ftmp6]                \n\t"
@@ -550,9 +550,9 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "paddh      %[ftmp4],   %[ftmp4],       %[ftmp3]                \n\t"
         "psubh      %[ftmp6],   %[ftmp6],       %[ftmp1]                \n\t"
         "paddh      %[ftmp3],   %[ftmp3],       %[ftmp3]                \n\t"
-        MMI_SDC1(%[ftmp6], $29, 0x08)
+        MMI_SDC1(%[ftmp6], $sp, 0x08)
         "psubh      %[ftmp3],   %[ftmp3],       %[ftmp4]                \n\t"
-        MMI_SDC1(%[ftmp7], $29, 0x18)
+        MMI_SDC1(%[ftmp7], $sp, 0x18)
         "dmfc1      %[tmp2],    %[ftmp0]                                \n\t"
         "xor        %[ftmp0],   %[ftmp0],       %[ftmp0]                \n\t"
         MMI_ULWC1(%[ftmp6], %[addr0], 0x00)
@@ -581,8 +581,8 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "packushb   %[ftmp7],   %[ftmp7],       %[ftmp0]                \n\t"
         MMI_SWC1(%[ftmp6], %[addr0], 0x00)
         MMI_SWXC1(%[ftmp7], %[addr0], %[stride], 0x00)
-        MMI_LDC1(%[ftmp2], $29, 0x08)
-        MMI_LDC1(%[ftmp5], $29, 0x18)
+        MMI_LDC1(%[ftmp2], $sp, 0x08)
+        MMI_LDC1(%[ftmp5], $sp, 0x18)
         PTR_ADDU   "%[addr0],   %[addr0],       %[stride]               \n\t"
         "dmtc1      %[tmp2],    %[ftmp1]                                \n\t"
         PTR_ADDU   "%[addr0],   %[addr0],       %[stride]               \n\t"
@@ -612,7 +612,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
         "packushb   %[ftmp7],   %[ftmp7],       %[ftmp0]                \n\t"
         MMI_SWC1(%[ftmp6], %[addr0], 0x00)
         MMI_SWXC1(%[ftmp7], %[addr0], %[stride], 0x00)
-        PTR_ADDIU  "$29,        $29,            0x20                    \n\t"
+        PTR_ADDIU  "$sp,        $sp,            0x20                    \n\t"
         : [ftmp0]"=&f"(ftmp[0]),            [ftmp1]"=&f"(ftmp[1]),
           [ftmp2]"=&f"(ftmp[2]),            [ftmp3]"=&f"(ftmp[3]),
           [ftmp4]"=&f"(ftmp[4]),            [ftmp5]"=&f"(ftmp[5]),
@@ -630,7 +630,7 @@  void ff_h264_idct8_add_8_mmi(uint8_t *dst, int16_t *block, int stride)
           [addr0]"=&r"(addr[0])
         : [dst]"r"(dst),                    [block]"r"(block),
           [stride]"r"((mips_reg)stride)
-        : "$29","memory"
+        : "memory"
     );
 
 }