Re: [PATCH RFC 12/67] MIPS: asm: asmmacro: Replace add instructions with "addui"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/18/2014 07:09 AM, Markos Chandras wrote:
The use of "add" instruction for immediate operations is wrong and
relies to gas being smart enough to notice that and replace it with
either addi or addui. However, MIPS R6 removed the addi instruction
so, fix this problem properly by using the correct instruction
directly.


This is another case of the use of "add" being a real bug. We should never have faulting instructions like this in the kernel.

Can you send all patches in this set that fix this bug as a separate patch? Since they are obviously correct, and really should be used by all non-R6 processors, we can get them in sooner that the entire R6 thing.

Thanks,
David Daney

Signed-off-by: Markos Chandras <markos.chandras@xxxxxxxxxx>
---
  arch/mips/include/asm/asmmacro.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index fe08084f5adb..55c07c40c199 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -304,7 +304,7 @@
  	.set	push
  	.set	noat
  	SET_HARDFLOAT
-	add	$1, \base, \off
+	addiu	$1, \base, \off
  	.word	LDD_MSA_INSN | (\wd << 6)
  	.set	pop
  	.endm
@@ -313,7 +313,7 @@
  	.set	push
  	.set	noat
  	SET_HARDFLOAT
-	add	$1, \base, \off
+	addiu	$1, \base, \off
  	.word	STD_MSA_INSN | (\wd << 6)
  	.set	pop
  	.endm







[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux