This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] RISC-V: Add gas support for "fp" register.
- From: Jim Wilson <jimw at sifive dot com>
- To: binutils at sourceware dot org
- Cc: sebastian dot huber at embedded-brains dot de, andrew dot burgess at embecosm dot com, Jim Wilson <jimw at sifive dot com>
- Date: Fri, 29 Jun 2018 15:16:06 -0700
- Subject: [PATCH] RISC-V: Add gas support for "fp" register.
The architecture manual lists fp as an alias for x8/s0, and gdb supports it
as an alias, but gas does not. This makes gas consistent with gdb.
Tested with some small hand written testcases, and the usual cross build and
make check for riscv{32,64}-{elf,linux}. There were no regressions.
Committed.
Jim
gas/
* config/tc-riscv.c (md_begin): Call hash_reg_name for "fp".
---
gas/config/tc-riscv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index bdec30741b..5ba997e6ca 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -853,6 +853,9 @@ md_begin (void)
hash_reg_names (RCLASS_FPR, riscv_fpr_names_numeric, NFPR);
hash_reg_names (RCLASS_FPR, riscv_fpr_names_abi, NFPR);
+ /* Add "fp" as an alias for "s0". */
+ hash_reg_name (RCLASS_GPR, "fp", 8);
+
opcode_names_hash = hash_new ();
init_opcode_names_hash ();
--
2.17.1