Commit f27d0731 authored by Markos Chandras's avatar Markos Chandras Committed by Luis Henriques

MIPS: asm: asmmacro: Replace "add" instructions with "addu"

commit 98a833c1 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: default avatarMarkos Chandras <markos.chandras@imgtec.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 0c24a6c4
......@@ -293,7 +293,7 @@
.macro ld_d wd, off, base
.set push
.set noat
add $1, \base, \off
addu $1, \base, \off
.word LDD_MSA_INSN | (\wd << 6)
.set pop
.endm
......@@ -301,7 +301,7 @@
.macro st_d wd, off, base
.set push
.set noat
add $1, \base, \off
addu $1, \base, \off
.word STD_MSA_INSN | (\wd << 6)
.set pop
.endm
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment