diff mbox

[FFmpeg-devel,4/7] avcodec/mips: [loongson] optimize ff_put_pixels16_8 V2.

Message ID 1528960756-17032-1-git-send-email-yinshiyou-hf@loongson.cn
State Superseded
Headers show

Commit Message

Shiyou Yin June 14, 2018, 7:19 a.m. UTC
Remove useless variable addr.

Change-Id: I0e91e6052dc5b44da3c0825d965ecba3dd1c9595
Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
---
 libavcodec/mips/hpeldsp_mmi.c | 43 ++++++++++++++++++++-----------------------
 1 file changed, 20 insertions(+), 23 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/mips/hpeldsp_mmi.c b/libavcodec/mips/hpeldsp_mmi.c
index 2dbef22..1bba70e 100644
--- a/libavcodec/mips/hpeldsp_mmi.c
+++ b/libavcodec/mips/hpeldsp_mmi.c
@@ -111,44 +111,41 @@  void ff_put_pixels16_8_mmi(uint8_t *block, const uint8_t *pixels,
     ptrdiff_t line_size, int h)
 {
     double ftmp[4];
-    mips_reg addr[2];
     DECLARE_VAR_ALL64;
-    DECLARE_VAR_ADDRT;
 
     __asm__ volatile (
-        PTR_ADDU   "%[addr1],   %[line_size],   %[line_size]            \n\t"
-        "1:                                                             \n\t"
-        PTR_ADDU   "%[addr0],   %[pixels],      %[line_size]            \n\t"
+        "1:                                                            \n\t"
         MMI_ULDC1(%[ftmp0], %[pixels], 0x00)
         MMI_ULDC1(%[ftmp2], %[pixels], 0x08)
-        MMI_ULDC1(%[ftmp1], %[addr0], 0x00)
-        MMI_ULDC1(%[ftmp3], %[addr0], 0x08)
+        PTR_ADDU   "%[pixels],  %[pixels],      %[line_size]           \n\t"
+        MMI_ULDC1(%[ftmp1], %[pixels], 0x00)
+        MMI_ULDC1(%[ftmp3], %[pixels], 0x08)
         MMI_SDC1(%[ftmp0], %[block], 0x00)
-        MMI_SDXC1(%[ftmp1], %[block], %[line_size], 0x00)
         MMI_SDC1(%[ftmp2], %[block], 0x08)
-        MMI_SDXC1(%[ftmp3], %[block], %[line_size], 0x08)
-        PTR_ADDU   "%[pixels],  %[pixels],      %[addr1]                \n\t"
-        PTR_ADDU   "%[block],   %[block],       %[addr1]                \n\t"
+        PTR_ADDU   "%[block],   %[block],       %[line_size]           \n\t"
+        MMI_SDC1(%[ftmp1], %[block], 0x00)
+        MMI_SDC1(%[ftmp3], %[block], 0x08)
+        PTR_ADDU   "%[pixels],  %[pixels],      %[line_size]           \n\t"
+        PTR_ADDU   "%[block],   %[block],       %[line_size]           \n\t"
 
-        PTR_ADDU   "%[addr0],   %[pixels],      %[line_size]            \n\t"
         MMI_ULDC1(%[ftmp0], %[pixels], 0x00)
         MMI_ULDC1(%[ftmp2], %[pixels], 0x08)
-        MMI_ULDC1(%[ftmp1], %[addr0], 0x00)
-        MMI_ULDC1(%[ftmp3], %[addr0], 0x08)
+        PTR_ADDU   "%[pixels],  %[pixels],      %[line_size]           \n\t"
+        MMI_ULDC1(%[ftmp1], %[pixels], 0x00)
+        MMI_ULDC1(%[ftmp3], %[pixels], 0x08)
         MMI_SDC1(%[ftmp0], %[block], 0x00)
-        MMI_SDXC1(%[ftmp1], %[block], %[line_size], 0x00)
         MMI_SDC1(%[ftmp2], %[block], 0x08)
-        MMI_SDXC1(%[ftmp3], %[block], %[line_size], 0x08)
-        PTR_ADDU   "%[pixels],  %[pixels],      %[addr1]                \n\t"
-        PTR_ADDU   "%[block],   %[block],       %[addr1]                \n\t"
-
-        PTR_ADDI   "%[h],       %[h],           -0x04                   \n\t"
-        "bnez       %[h],       1b                                      \n\t"
+        PTR_ADDU   "%[block],   %[block],       %[line_size]           \n\t"
+        MMI_SDC1(%[ftmp1], %[block], 0x00)
+        MMI_SDC1(%[ftmp3], %[block], 0x08)
+        PTR_ADDU   "%[pixels],  %[pixels],      %[line_size]           \n\t"
+        PTR_ADDU   "%[block],   %[block],       %[line_size]           \n\t"
+
+        PTR_ADDI   "%[h],       %[h],           -0x04                  \n\t"
+        "bnez       %[h],       1b                                     \n\t"
         : [ftmp0]"=&f"(ftmp[0]),            [ftmp1]"=&f"(ftmp[1]),
           [ftmp2]"=&f"(ftmp[2]),            [ftmp3]"=&f"(ftmp[3]),
           RESTRICT_ASM_ALL64
-          RESTRICT_ASM_ADDRT
-          [addr0]"=&r"(addr[0]),            [addr1]"=&r"(addr[1]),
           [block]"+&r"(block),              [pixels]"+&r"(pixels),
           [h]"+&r"(h)
         : [line_size]"r"((mips_reg)line_size)