From f0bdf8c1691c9509eaebab323754e0530d4ff5d7 Mon Sep 17 00:00:00 2001 From: Jiawei Date: Tue, 24 Sep 2024 19:16:25 +0800 Subject: RISC-V: Add Smrnmi extension csrs. This patch support Smrnmi extension[1], The csrs address can be find in[2]. [1] https://github.com/riscv/riscv-isa-manual/commit/35eb3948bf0b87c83fab5a7238bd68b6211faf62 [2] https://github.com/riscv/riscv-isa-manual/blob/smrnmi-1.0/src/priv-csrs.adoc bfd/ChangeLog: * elfxx-riscv.c: New extension. gas/ChangeLog: * NEWS: Add Smrnmi extension support. * config/tc-riscv.c (enum riscv_csr_class): New extension class. (riscv_csr_address): Ditto. * testsuite/gas/riscv/csr-version-1p10.d: New csrs. * testsuite/gas/riscv/csr-version-1p10.l: Ditto. * testsuite/gas/riscv/csr-version-1p11.d: Ditto. * testsuite/gas/riscv/csr-version-1p11.l: Ditto. * testsuite/gas/riscv/csr-version-1p12.d: Ditto. * testsuite/gas/riscv/csr-version-1p12.l: Ditto. * testsuite/gas/riscv/csr.s: Ditto. * testsuite/gas/riscv/march-help.l: New extension. include/ChangeLog: * opcode/riscv-opc.h (CSR_MNSCRATCH): New csr. (CSR_MNEPC): Ditto. (CSR_MNCAUSE): Ditto. (CSR_MNSTATUS): Ditto. (DECLARE_CSR): New csr declarations. --- gas/config/tc-riscv.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gas/config') diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index bf2020d..301607b 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -81,6 +81,7 @@ enum riscv_csr_class CSR_CLASS_SMCSRIND, /* Smcsrind */ CSR_CLASS_SMCNTRPMF, /* Smcntrpmf */ CSR_CLASS_SMCNTRPMF_32, /* Smcntrpmf, rv32 only */ + CSR_CLASS_SMRNMI, /* Smrnmi */ CSR_CLASS_SMSTATEEN, /* Smstateen only */ CSR_CLASS_SMSTATEEN_32, /* Smstateen RV32 only */ CSR_CLASS_SSAIA, /* Ssaia */ @@ -1082,6 +1083,9 @@ riscv_csr_address (const char *csr_name, need_check_version = true; extension = "smcntrpmf"; break; + case CSR_CLASS_SMRNMI: + extension = "smrnmi"; + break; case CSR_CLASS_SMSTATEEN_32: is_rv32_only = true; /* Fall through. */ -- cgit v1.1