diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2023-04-09 13:43:06 +0300 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2024-02-28 14:25:52 +0300 |
commit | af43e871c93640a69af58ddb33aec2d4be80bf6b (patch) | |
tree | 1c3130d13eee174833d629e04645682fa18c8d09 | |
parent | 188942f05ce45f80c06f7242ad7478bd204c3387 (diff) | |
download | linux-af43e871c93640a69af58ddb33aec2d4be80bf6b.tar.xz |
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>
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index d2c7bc241a84..3c6ddc0c2c7a 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -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" \ |