[1/2] RISC-V: Add complex CSR error handling
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Testing passed
|
Commit Message
From: Tsukasa OI <research_trasio@irq.a4lg.com>
This commit adds template for complex CSR error handling (such like
multiple extensions involved).
gas/ChangeLog:
* config/tc-riscv.c (riscv_csr_address): Add complex CSR error
handling.
---
gas/config/tc-riscv.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -1020,6 +1020,8 @@ riscv_csr_address (const char *csr_name,
bool need_check_version = false;
bool is_rv32_only = false;
bool is_h_required = false;
+ bool is_csr_req_complex = false;
+ bool csr_ok = false;
const char* extension = NULL;
switch (csr_class)
@@ -1106,8 +1108,10 @@ riscv_csr_address (const char *csr_name,
if (is_h_required && !riscv_subset_supports (&riscv_rps_as, "h"))
as_warn (_("invalid CSR `%s', needs `h' extension"), csr_name);
- if (extension != NULL
- && !riscv_subset_supports (&riscv_rps_as, extension))
+ if (is_csr_req_complex
+ ? !csr_ok
+ : (extension != NULL
+ && !riscv_subset_supports (&riscv_rps_as, extension)))
as_warn (_("invalid CSR `%s', needs `%s' extension"),
csr_name, extension);
}