RISC-V: PR28733, add missing extension info to 'invalid CSR' error
authorPatrick O'Neill <patrick@rivosinc.com>
Fri, 21 Jan 2022 17:22:00 +0000 (09:22 -0800)
committerNelson Chu <nelson.chu@sifive.com>
Wed, 23 Feb 2022 11:08:19 +0000 (19:08 +0800)
commitdf0a549ebdae74ef9d233243b869d424e6a33c73
treefacbdc06b1ed441bc71c04fbe96367e9a0a4a01c
parentcebc89b9328eab994f6b0314c263f94e7949a553
RISC-V: PR28733, add missing extension info to 'invalid CSR' error

Currently we report errors as "invalid CSR 'fscr' for the current ISA"
when the instruction isn't valid.

This patch expands that error message to include the missing extension
information. For example, now the error message would be "invalid CSR
'fscr' for the current ISA, CSR 'fscr' needs 'f' extension".

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
gas/
pr 28733
* config/tc-riscv.c (riscv_csr_address): Report more details
when the CSR is invalid.
* testsuite/gas/riscv/csr-version-1p10.l: Updated detailed errors.
* testsuite/gas/riscv/csr-version-1p11.l: Likewise.
* testsuite/gas/riscv/csr-version-1p12.l: Likewise.
* testsuite/gas/riscv/csr-version-1p9p1.l: Likewise.
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/csr-version-1p10.l
gas/testsuite/gas/riscv/csr-version-1p11.l
gas/testsuite/gas/riscv/csr-version-1p12.l
gas/testsuite/gas/riscv/csr-version-1p9p1.l