+2017-11-07 Palmer Dabbelt <palmer@dabbelt.com>
+
+ * testsuite/gas/riscv/satp.d: New test.
+ testsuite/gas/riscv/satp.s: Likewise.
+ testsuite/gas/riscv/riscv.exp: Likewise.
+ config/tc-riscv.c (md_begin): Handle CSR aliases.
+
2017-11-07 Tamar Christina <tamar.christina@arm.com>
* config/tc-arm.c (arm_cpus):
hash_reg_names (RCLASS_FPR, riscv_fpr_names_abi, NFPR);
#define DECLARE_CSR(name, num) hash_reg_name (RCLASS_CSR, #name, num);
+#define DECLARE_CSR_ALIAS(name, num) DECLARE_CSR(name, num);
#include "opcode/riscv-opc.h"
#undef DECLARE_CSR
run_dump_test "c-lui-fail"
run_dump_test "c-addi4spn-fail"
run_dump_test "c-addi16sp-fail"
+ run_dump_test "satp"
}
--- /dev/null
+#as:
+#objdump: -dr
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+0:[ ]+180022f3[ ]+csrr[ ]+t0,satp
+[ ]+4:[ ]+180022f3[ ]+csrr[ ]+t0,satp
--- /dev/null
+target:
+ csrr t0, satp
+ csrr t0, sptbr
+2017-11-07 Palmer Dabbelt <palmer@dabbelt.com>
+
+ * opcode/riscv-opc.h (sptbr): Rename to satp.
+ (CSR_SPTBR): Rename to CSR_SATP.
+ (sptbr): Alias to CSR_SATP.
+
2017-11-07 Tamar Christina <tamar.christina@arm.com>
* opcode/arm.h (FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_DOTPROD):
#define CSR_SCAUSE 0x142
#define CSR_SBADADDR 0x143
#define CSR_SIP 0x144
-#define CSR_SPTBR 0x180
+#define CSR_SATP 0x180
#define CSR_MSTATUS 0x300
#define CSR_MISA 0x301
#define CSR_MEDELEG 0x302
DECLARE_CSR(scause, CSR_SCAUSE)
DECLARE_CSR(sbadaddr, CSR_SBADADDR)
DECLARE_CSR(sip, CSR_SIP)
-DECLARE_CSR(sptbr, CSR_SPTBR)
+DECLARE_CSR(satp, CSR_SATP)
DECLARE_CSR(mstatus, CSR_MSTATUS)
DECLARE_CSR(misa, CSR_MISA)
DECLARE_CSR(medeleg, CSR_MEDELEG)
DECLARE_CSR(mhpmcounter30h, CSR_MHPMCOUNTER30H)
DECLARE_CSR(mhpmcounter31h, CSR_MHPMCOUNTER31H)
#endif
+#ifdef DECLARE_CSR_ALIAS
+DECLARE_CSR_ALIAS(sptbr, CSR_SATP)
+#endif
#ifdef DECLARE_CAUSE
DECLARE_CAUSE("misaligned fetch", CAUSE_MISALIGNED_FETCH)
DECLARE_CAUSE("fault fetch", CAUSE_FAULT_FETCH)