riscv / riscv-isa-manual

RISC-V Instruction Set Manual
https://riscv.org/
Creative Commons Attribution 4.0 International
3.6k stars 623 forks source link

`Zbc` missing from `B` extension description? #1314

Open TommyMurphyTM1234 opened 5 months ago

TommyMurphyTM1234 commented 5 months ago

From the latest draft:

Shouldn't Zbc be mentioned here in the part highlighted in red? Especially given that it's mentioned in the parts highlighted in orange?

2024-04-03 14 57 12

ved-rivos commented 5 months ago

B only implies Zba + Zbb + Zbs.

TommyMurphyTM1234 commented 5 months ago

Thanks @ved-rivos. So why is the Zbc extension described under the chapter heading "B" Standard Extension for Bit Manipulation, Version 1.0.0 if it seemingly has nothing to do with B? Seems confusing?

ved-rivos commented 5 months ago

Zbc is part of the bit manipulation suite of extensions but not B. Some restructuring would be useful to make that more explicit.

TommyMurphyTM1234 commented 5 months ago

So, the bit-manpulation extension "hierarchy" is basically:

Does B also mean that b in an architecture string implies zba_zbb_zbs (e.g. rv64imafdcb/lp64d == rv64imafdc_zbb_zbc_zbs/lp64d?) Should that work with the latest riscv-gnu-toolchain based on GCC 13.2? Or only with the latest upstream GCC master or something else?

ved-rivos commented 5 months ago

That looks right. The patches have been created for GCC. I am not sure which version of toolchain.

TommyMurphyTM1234 commented 5 months ago

That looks right. The patches have been created for GCC. I am not sure which version of toolchain.

Thanks @ved-rivos. This post:

seems to suggest that the patch has still not been integrated but it's not clear to me what "proposal" is holding it up? Maybe a proposal to clarify that B/b means Zba/Zbb/Zbs and not also Zbc?

Compiling the RISC-V toolchain (riscg-gnu-toolchain) also shows that the changes in that patch are not present in the upstream GCC master.

ved-rivos commented 5 months ago

seems to suggest that the patch has still not been integrated but it's not clear to me what "proposal" is holding it up?

Perhaps the maintainers were waiting for the specification to Freeze. The specification has Frozen and completed public review since then and is in process of being ratified.

Maybe a proposal to clarify that B/b means Zba/Zbb/Zbs and not also Zbc?

That was the done and is the basis for the patch : https://github.com/riscv/riscv-b

TommyMurphyTM1234 commented 5 months ago

Thanks @ved-rivos.

Perhaps the maintainers were waiting for the specification to Freeze. The specification has Frozen and completed public review since then and is in process of being ratified.

That's confusing - according to this it was ratified November 2021:

The date of the patch mailing list post is 13 February 2024.

ved-rivos commented 5 months ago

I hope you saw : https://github.com/riscv/riscv-b

While the Zba, Zbb, Zbs, and Zbc extensions were ratified in Nov 21, the official standardization of B as representing the collection of the Zba, Zbb, and Zbs extensions was done recently and is the point of the patch. The official B extension is now Frozen and has completed public review and expected to be ratified in a few weeks.

TommyMurphyTM1234 commented 5 months ago

I hope you saw : https://github.com/riscv/riscv-b

While the Zba, Zbb, Zbs, and Zbc extensions were ratified in Nov 21, the official standardization of B as representing the collection of the Zba, Zbb, and Zbs extensions was done recently and is the point of the patch. The official B extension is now Frozen and has completed public review and expected to be ratified in a few weeks.

Sorry - I didn't. Thanks for pointing that out. 👍

Edit: ah - that page doesn't actually say "While the Zba, Zbb, Zbs, and Zbc extensions were ratified in Nov 21, the official standardization of B as representing the collection of the Zba, Zbb, and Zbs extensions was done recently and is the point of the patch". That wording on that page might have saved some confusion.

And it's confusing that it doesn't seem to be listed on any of the pages linked from here:

only on the "ratified extensions" page linked from here:

ved-rivos commented 5 months ago

The ratification of the B standard extension i.e. codifying B=Zba+Zbb+Zbs is not yet done. It is expected to be ratified by end of this month. Thats why it does not show up under ratified extensions yet.

If you navigate from https://wiki.riscv.org/display/HOME/Specification+Status to https://wiki.riscv.org/display/HOME/All+Specifications+Under+Development You will see "B Extension Components SPECIFICATION IN RATIFICATION-READY ISA Yes https://github.com/riscv/riscv-b Zba,Zbb,Zbs Apr 25, 2024 Apr 04, 2024"

TommyMurphyTM1234 commented 5 months ago

If you navigate from https://wiki.riscv.org/display/HOME/Specification+Status to https://wiki.riscv.org/display/HOME/All+Specifications+Under+Development You will see "B Extension Components SPECIFICATION IN RATIFICATION-READY ISA Yes https://github.com/riscv/riscv-b Zba,Zbb,Zbs Apr 25, 2024 Apr 04, 2024"

Thanks @ved-rivos - I had gone to that page but simply did browser page search for "bit" and "manip" and didn't see anything so I didn't notice that one.

ved-rivos commented 4 months ago

@TommyMurphyTM1234 - The ratified extension is published here .