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 Fri, 19 Dec 2014, 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.

 Not true, depending on the arguments the ADD assembly macro expands to 
either of the ADD and the ADDI hardware instructions; where an immediate 
outside the 16-bit signed range is used it also expands to a longer 
sequence involving LUI and the actual operation is ADD.  It never expands 
to ADDIU (which I gather you meant).

> > 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
> 
> sure i will move these patches away from R6 and post them separately.

 I think using the ADDU macro is preferred here as it allows arbitrary 
32-bit values for `off', just like with memory references in MIPS assembly 
instructions.

  Maciej




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

  Powered by Linux