diff mbox

[FFmpeg-devel] MIPS: replace addi with addiu

Message ID 20190702035243.777-1-syq@debian.org
State Accepted
Commit 925e33b253c81112960854c61cdbb71682e51f4b
Headers show

Commit Message

YunQiang Su July 2, 2019, 3:52 a.m. UTC
addi/daddi are deprecated by MIPS for years, and MIPS r6 remove
them.

They should be replace with addiu:
   ADDIU performs the same arithmetic operation but
   does not trap on overflow.
---
 libavcodec/mips/cabac.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shiyou Yin July 9, 2019, 1:10 p.m. UTC | #1
>-----Original Message-----
>From: ffmpeg-devel-bounces@ffmpeg.org [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of
>YunQiang Su
>Sent: Tuesday, July 2, 2019 11:53 AM
>To: ffmpeg-devel@ffmpeg.org
>Cc: YunQiang Su
>Subject: [FFmpeg-devel] [PATCH] MIPS: replace addi with addiu
>
>addi/daddi are deprecated by MIPS for years, and MIPS r6 remove
>them.
>
>They should be replace with addiu:
>   ADDIU performs the same arithmetic operation but
>   does not trap on overflow.
>---
> libavcodec/mips/cabac.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/libavcodec/mips/cabac.h b/libavcodec/mips/cabac.h
>index 82cee29..2a05e5a 100644
>--- a/libavcodec/mips/cabac.h
>+++ b/libavcodec/mips/cabac.h
>@@ -72,7 +72,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c,
>
>         "and          %[tmp0],       %[c_low],       %[cabac_mask] \n\t"
>         "bnez         %[tmp0],       1f                            \n\t"
>-        PTR_ADDI     "%[tmp0],       %[c_low],       -0X01         \n\t"
>+        PTR_ADDIU    "%[tmp0],       %[c_low],       -0x01         \n\t"
>         "xor          %[tmp0],       %[c_low],       %[tmp0]       \n\t"
>         PTR_SRA      "%[tmp0],       %[tmp0],        0x0f          \n\t"
>         PTR_ADDU     "%[tmp0],       %[tmp0],        %[tables]     \n\t"
>--
>2.20.1
>

good suggestion.
Michael Niedermayer July 10, 2019, 10:56 a.m. UTC | #2
On Tue, Jul 09, 2019 at 09:10:33PM +0800, Shiyou Yin wrote:
> >-----Original Message-----
> >From: ffmpeg-devel-bounces@ffmpeg.org [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of
> >YunQiang Su
> >Sent: Tuesday, July 2, 2019 11:53 AM
> >To: ffmpeg-devel@ffmpeg.org
> >Cc: YunQiang Su
> >Subject: [FFmpeg-devel] [PATCH] MIPS: replace addi with addiu
> >
> >addi/daddi are deprecated by MIPS for years, and MIPS r6 remove
> >them.
> >
> >They should be replace with addiu:
> >   ADDIU performs the same arithmetic operation but
> >   does not trap on overflow.
> >---
> > libavcodec/mips/cabac.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/libavcodec/mips/cabac.h b/libavcodec/mips/cabac.h
> >index 82cee29..2a05e5a 100644
> >--- a/libavcodec/mips/cabac.h
> >+++ b/libavcodec/mips/cabac.h
> >@@ -72,7 +72,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c,
> >
> >         "and          %[tmp0],       %[c_low],       %[cabac_mask] \n\t"
> >         "bnez         %[tmp0],       1f                            \n\t"
> >-        PTR_ADDI     "%[tmp0],       %[c_low],       -0X01         \n\t"
> >+        PTR_ADDIU    "%[tmp0],       %[c_low],       -0x01         \n\t"
> >         "xor          %[tmp0],       %[c_low],       %[tmp0]       \n\t"
> >         PTR_SRA      "%[tmp0],       %[tmp0],        0x0f          \n\t"
> >         PTR_ADDU     "%[tmp0],       %[tmp0],        %[tables]     \n\t"
> >--
> >2.20.1
> >
> 
> good suggestion.

will apply

thanks

[...]
diff mbox

Patch

diff --git a/libavcodec/mips/cabac.h b/libavcodec/mips/cabac.h
index 82cee29..2a05e5a 100644
--- a/libavcodec/mips/cabac.h
+++ b/libavcodec/mips/cabac.h
@@ -72,7 +72,7 @@  static av_always_inline int get_cabac_inline(CABACContext *c,
 
         "and          %[tmp0],       %[c_low],       %[cabac_mask] \n\t"
         "bnez         %[tmp0],       1f                            \n\t"
-        PTR_ADDI     "%[tmp0],       %[c_low],       -0X01         \n\t"
+        PTR_ADDIU    "%[tmp0],       %[c_low],       -0x01         \n\t"
         "xor          %[tmp0],       %[c_low],       %[tmp0]       \n\t"
         PTR_SRA      "%[tmp0],       %[tmp0],        0x0f          \n\t"
         PTR_ADDU     "%[tmp0],       %[tmp0],        %[tables]     \n\t"