MIPS: mipsregs: Parse fp and sp register by name in parse_r
parse_r helper is used to parse register number from oprand, it only handles oprand which use number to refer register before. However compiler may use $gp and $sp to reference register 29 and 30. Handle this situation by adding relevant match name. Fixes compilation error: {standard input}: Assembler messages: {standard input}:1937: Error: Unable to parse register name $fp Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
parent
188942f05c
commit
af43e871c9
@ -1422,11 +1422,13 @@ static inline int mm_insn_16bit(u16 insn)
|
||||
*/
|
||||
|
||||
/* Match an individual register number and assign to \var */
|
||||
#define _IFC_REG(n) \
|
||||
".ifc \\r, $" #n "\n\t" \
|
||||
#define _IFC_REG_NAME(name, n) \
|
||||
".ifc \\r, $" #name "\n\t" \
|
||||
"\\var = " #n "\n\t" \
|
||||
".endif\n\t"
|
||||
|
||||
#define _IFC_REG(n) _IFC_REG_NAME(n, n)
|
||||
|
||||
#define _ASM_SET_PARSE_R \
|
||||
".macro parse_r var r\n\t" \
|
||||
"\\var = -1\n\t" \
|
||||
@ -1438,6 +1440,7 @@ static inline int mm_insn_16bit(u16 insn)
|
||||
_IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) \
|
||||
_IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) \
|
||||
_IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) \
|
||||
_IFC_REG_NAME(sp, 29) _IFC_REG_NAME(fp, 30) \
|
||||
".iflt \\var\n\t" \
|
||||
".error \"Unable to parse register name \\r\"\n\t" \
|
||||
".endif\n\t" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user