Bug 29341

Summary: RISC-V: -march=rv32imcb fails due to cannot find default versions of the ISA extension `b'
Product: binutils Reporter: H. Peter Anvin <hpa>
Component: gasAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED NOTABUG    
Severity: normal CC: nelsonc1225, research_trasio
Priority: P2    
Version: 2.38   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description H. Peter Anvin 2022-07-08 22:39:31 UTC
Specifying -march=rv32imcb (or any other combination that includes the "b" extension) invariably causes the error message:

[hpa@tazenda tmp]$ riscv32-unknown-elf-as -march=rv32imcb -o b-ext.o b-ext.s 
Assembler messages:
Error: cannot find default versions of the ISA extension `b'
b-ext.s:2: Error: unrecognized opcode `clz a0,a0'
... many more ...


Enumerating sub-extensions work:

riscv32-unknown-elf-as -march=rv32imc_zba_zbb_zbc_zbs -o b-ext.o b-ext.s


This is using b-ext.s from gas/testsuite/gas/riscv/b-ext.s as test case.
Comment 1 Tsukasa OI 2022-07-28 11:42:04 UTC
I think this is not a bug.

Note that, 'B' will not be a single extension (at least for now) [1] but multiple extensions with 'Zb*' names are be defined and ratified.

For instance, upcoming RVA22U64 profile [2] considers following extensions mandatory:

-   Zba  (address computation)
-   Zbb  (basic bit manipulation)
-   Zbs  (single-bit fiddling)

and following extensions unsupported optional:

-   Zbc  (carry-less multiply)
-   Zbkb (crypto-related subextension)
-   Zbkc (crypto-related subextension)
-   Zbkx (crypto-related subextension)

Try using those extensions instead.

[1]: https://github.com/riscv/riscv-isa-manual/commit/c1c77c4902d5e7c58613d725d09d66a2a743da1c
[2]: https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc
Comment 2 Nelson Chu 2022-09-05 06:17:24 UTC
Consider this, https://github.com/bminor/binutils-gdb/commit/3a3e333f65483b864bf2624392f8aa4a88c7a498.

Since the base b extension hasn't been ratified, so marked as RESOLVED and NOTABUG.