]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Fix missing instruction classes in error messages
authorJerry Zhang Jian <jerry.zhangjian@sifive.com>
Wed, 5 Nov 2025 02:18:20 +0000 (10:18 +0800)
committerNelson Chu <nelson@rivosinc.com>
Thu, 6 Nov 2025 00:53:54 +0000 (08:53 +0800)
commit7c4cf28243297b55976db28230bb2f02e6335fc4
tree59151a7ebcabbde052100cabc5f370bb58e82e67
parent91c02fa793b7ed62b46cfc0a5d60530b94b44e5c
RISC-V: Fix missing instruction classes in error messages

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