Skip to content

Commit ef20dc5

Browse files
Markos Chandrasgregkh
authored andcommitted
MIPS: asm: asmmacro: Replace "add" instructions with "addu"
commit 98a833c upstream. The "add" instruction is actually a macro in binutils and depending on the size of the immediate it can expand to an "addi" instruction. However, the "addi" instruction traps on overflows which is not something we want on address calculation. Link: http://www.linux-mips.org/archives/linux-mips/2015-01/msg00121.html Cc: Paul Burton <paul.burton@imgtec.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2aac25e commit ef20dc5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/mips/include/asm/asmmacro.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
.set push
305305
.set noat
306306
SET_HARDFLOAT
307-
add $1, \base, \off
307+
addu $1, \base, \off
308308
.word LDD_MSA_INSN | (\wd << 6)
309309
.set pop
310310
.endm
@@ -313,7 +313,7 @@
313313
.set push
314314
.set noat
315315
SET_HARDFLOAT
316-
add $1, \base, \off
316+
addu $1, \base, \off
317317
.word STD_MSA_INSN | (\wd << 6)
318318
.set pop
319319
.endm

0 commit comments

Comments
 (0)