[PATCH] RISC-V: Fix missing instruction classes in error messages
Jerry Zhang Jian
jerry.zhangjian@sifive.com
Wed Nov 5 02:18:20 GMT 2025
More information about the Binutils mailing list
Wed Nov 5 02:18:20 GMT 2025
- Previous message (by thread): [committed] hppa64: Fix some issues handling dynamic relocaltions
- Next message (by thread): [PATCH] RISC-V: Fix missing instruction classes in error messages
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Add 6 missing instruction class cases to riscv_multi_subset_supports_ext()
to provide proper extension names in error messages instead of producing
"internal: unreachable INSN_CLASS_*" errors.
These instruction classes exist in riscv_multi_subset_supports() but were
missing from riscv_multi_subset_supports_ext(), causing the assembler to
produce internal errors when instructions are used without the required
-march specification.
Missing classes added:
- INSN_CLASS_ZABHA_AND_ZACAS (zabha and zacas)
- INSN_CLASS_XVENTANACONDOPS (xventanacondops)
- INSN_CLASS_XSFVCP (xsfvcp)
- INSN_CLASS_XSFVQMACCQOQ (xsfvqmaccqoq)
- INSN_CLASS_XSFVQMACCDOD (xsfvqmaccdod)
- INSN_CLASS_XSFVFNRCLIPXFQF (xsfvfnrclipxfqf)
Before this fix:
Error: internal: unreachable INSN_CLASS_*
Error: unrecognized opcode `amocas.b a0,a1,(a2)'
After this fix:
Error: unrecognized opcode `amocas.b a0,a1,(a2)', extension `zabha' and `zacas' required
bfd/
* elfxx-riscv.c (riscv_multi_subset_supports_ext): Add 6
missing instruction class cases.
Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
---
bfd/elfxx-riscv.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 085d77923a0..3b92fbed5f0 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -3128,6 +3128,15 @@ riscv_multi_subset_supports_ext (riscv_parse_subset_t *rps,
return "zabha";
case INSN_CLASS_ZACAS:
return "zacas";
+ case INSN_CLASS_ZABHA_AND_ZACAS:
+ if (!riscv_subset_supports (rps, "zabha"))
+ {
+ if (!riscv_subset_supports (rps, "zacas"))
+ return _ ("zabha' and `zacas");
+ else
+ return "zabha";
+ }
+ return "zacas";
case INSN_CLASS_ZALRSC:
return "zalrsc";
case INSN_CLASS_ZAWRS:
@@ -3341,8 +3350,18 @@ riscv_multi_subset_supports_ext (riscv_parse_subset_t *rps,
return "xtheadvdot";
case INSN_CLASS_XTHEADZVAMO:
return "xtheadzvamo";
+ case INSN_CLASS_XVENTANACONDOPS:
+ return "xventanacondops";
+ case INSN_CLASS_XSFVCP:
+ return "xsfvcp";
case INSN_CLASS_XSFCEASE:
return "xsfcease";
+ case INSN_CLASS_XSFVQMACCQOQ:
+ return "xsfvqmaccqoq";
+ case INSN_CLASS_XSFVQMACCDOD:
+ return "xsfvqmaccdod";
+ case INSN_CLASS_XSFVFNRCLIPXFQF:
+ return "xsfvfnrclipxfqf";
default:
rps->error_handler
(_("internal: unreachable INSN_CLASS_*"));
--
2.51.1
- Previous message (by thread): [committed] hppa64: Fix some issues handling dynamic relocaltions
- Next message (by thread): [PATCH] RISC-V: Fix missing instruction classes in error messages
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list