From e0393d6a3185501f59baf26f49a5501f5fb1131f Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Wed, 17 Sep 2025 02:34:09 +0000 Subject: [PATCH 1/5] RISC-V: Remove non-existent `Zb` The `Zb` extension does not exist and we instead have the `B` extension which is a superset of the three subextensions: `Zba`, `Zbb` and `Zbs`. For now (since `B` extension is not stabilized on Rust), this commit just removes `Zb`. --- src/attributes/codegen.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 8d7948163..2abcd8383 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -503,7 +503,6 @@ Feature | Implicitly Enables | Description `a` | | [A][rv-a] --- Atomic instructions `c` | | [C][rv-c] --- Compressed instructions `m` | | [M][rv-m] --- Integer Multiplication and Division instructions -`zb` | `zba`, `zbc`, `zbs` | [Zb][rv-zb] --- Bit Manipulation instructions `zba` | | [Zba][rv-zb-zba] --- Address Generation instructions `zbb` | | [Zbb][rv-zb-zbb] --- Basic bit-manipulation `zbc` | | [Zbc][rv-zb-zbc] --- Carry-less multiplication @@ -527,7 +526,6 @@ Feature | Implicitly Enables | Description [rv-a]: https://github.com/riscv/riscv-isa-manual/blob/de46343a245c6ee1f7b1a40c92fe1a86bd4f4978/src/a-st-ext.adoc [rv-c]: https://github.com/riscv/riscv-isa-manual/blob/de46343a245c6ee1f7b1a40c92fe1a86bd4f4978/src/c-st-ext.adoc [rv-m]: https://github.com/riscv/riscv-isa-manual/blob/de46343a245c6ee1f7b1a40c92fe1a86bd4f4978/src/m-st-ext.adoc -[rv-zb]: https://github.com/riscv/riscv-bitmanip [rv-zb-zba]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zba.adoc [rv-zb-zbb]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbb.adoc [rv-zb-zbc]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbc.adoc From b04ae338886157794684e37d727e8391aebf4771 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Wed, 17 Sep 2025 02:34:09 +0000 Subject: [PATCH 2/5] RISC-V: Reference to ISA Manual, version 20250508 This is the latest ratified ISA Manual version and more importantly, some individual documents are merged into this. So, this commit consistently use this Manual (this version) where possible. Along with this, this commit substitutes link IDs from `rv-zb-*` to `rv-*` because `rv-zb-*` will look like the different document (bit-manipulation) is referenced. --- src/attributes/codegen.md | 59 ++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 2abcd8383..e58ef838a 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -492,10 +492,11 @@ On this platform the usage of `#[target_feature]` functions follows the [above restrictions][attributes.codegen.target_feature.safety-restrictions]. Further documentation on these features can be found in their respective -specification. Many specifications are described in the [RISC-V ISA Manual] or -in another manual hosted on the [RISC-V GitHub Account]. +specification. Many specifications are described in the [RISC-V ISA Manual], +[version 20250508] or in another manual hosted on the [RISC-V GitHub Account]. [RISC-V ISA Manual]: https://github.com/riscv/riscv-isa-manual +[version 20250508]: https://github.com/riscv/riscv-isa-manual/tree/20250508 [RISC-V GitHub Account]: https://github.com/riscv Feature | Implicitly Enables | Description @@ -503,13 +504,13 @@ Feature | Implicitly Enables | Description `a` | | [A][rv-a] --- Atomic instructions `c` | | [C][rv-c] --- Compressed instructions `m` | | [M][rv-m] --- Integer Multiplication and Division instructions -`zba` | | [Zba][rv-zb-zba] --- Address Generation instructions -`zbb` | | [Zbb][rv-zb-zbb] --- Basic bit-manipulation -`zbc` | | [Zbc][rv-zb-zbc] --- Carry-less multiplication -`zbkb` | | [Zbkb][rv-zb-zbkb] --- Bit Manipulation Instructions for Cryptography -`zbkc` | | [Zbkc][rv-zb-zbc] --- Carry-less multiplication for Cryptography -`zbkx` | | [Zbkx][rv-zb-zbkx] --- Crossbar permutations -`zbs` | | [Zbs][rv-zb-zbs] --- Single-bit instructions +`zba` | | [Zba][rv-zba] --- Address Generation instructions +`zbb` | | [Zbb][rv-zbb] --- Basic bit-manipulation +`zbc` | | [Zbc][rv-zbc] --- Carry-less multiplication +`zbkb` | | [Zbkb][rv-zbkb] --- Bit Manipulation Instructions for Cryptography +`zbkc` | | [Zbkc][rv-zbc] --- Carry-less multiplication for Cryptography +`zbkx` | | [Zbkx][rv-zbkx] --- Crossbar permutations +`zbs` | | [Zbs][rv-zbs] --- Single-bit instructions `zk` | `zkn`, `zkr`, `zks`, `zkt`, `zbkb`, `zbkc`, `zkbx` | [Zk][rv-zk] --- Scalar Cryptography `zkn` | `zknd`, `zkne`, `zknh`, `zbkb`, `zbkc`, `zkbx` | [Zkn][rv-zkn] --- NIST Algorithm suite extension `zknd` | | [Zknd][rv-zknd] --- NIST Suite: AES Decryption @@ -523,26 +524,26 @@ Feature | Implicitly Enables | Description -[rv-a]: https://github.com/riscv/riscv-isa-manual/blob/de46343a245c6ee1f7b1a40c92fe1a86bd4f4978/src/a-st-ext.adoc -[rv-c]: https://github.com/riscv/riscv-isa-manual/blob/de46343a245c6ee1f7b1a40c92fe1a86bd4f4978/src/c-st-ext.adoc -[rv-m]: https://github.com/riscv/riscv-isa-manual/blob/de46343a245c6ee1f7b1a40c92fe1a86bd4f4978/src/m-st-ext.adoc -[rv-zb-zba]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zba.adoc -[rv-zb-zbb]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbb.adoc -[rv-zb-zbc]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbc.adoc -[rv-zb-zbkb]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbkb.adoc -[rv-zb-zbkc]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbkc.adoc -[rv-zb-zbkx]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbkx.adoc -[rv-zb-zbs]: https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/zbs.adoc -[rv-zk]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zk.adoc -[rv-zkn]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zkn.adoc -[rv-zkne]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zkne.adoc -[rv-zknd]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zknd.adoc -[rv-zknh]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zknh.adoc -[rv-zkr]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zkr.adoc -[rv-zks]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zks.adoc -[rv-zksed]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zksed.adoc -[rv-zksh]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zksh.adoc -[rv-zkt]: https://github.com/riscv/riscv-crypto/blob/e2dd7d98b7f34d477e38cb5fd7a3af4379525189/doc/scalar/riscv-crypto-scalar-zkt.adoc +[rv-a]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/a-st-ext.adoc +[rv-c]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/c-st-ext.adoc +[rv-m]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/m-st-ext.adoc +[rv-zba]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zbb]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zbc]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zbkb]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zbkc]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zbkx]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zbs]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc +[rv-zk]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zkn]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zkne]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zknd]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zknh]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zkr]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zks]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zksed]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zksh]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc +[rv-zkt]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/scalar-crypto.adoc r[attributes.codegen.target_feature.wasm] #### `wasm32` or `wasm64` From 11c02f56bea1cb36a13523b24621a69a23edfbc6 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Wed, 17 Sep 2025 02:34:09 +0000 Subject: [PATCH 3/5] RISC-V: Fix link for `zbkc` --- src/attributes/codegen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index e58ef838a..acb22c852 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -508,7 +508,7 @@ Feature | Implicitly Enables | Description `zbb` | | [Zbb][rv-zbb] --- Basic bit-manipulation `zbc` | | [Zbc][rv-zbc] --- Carry-less multiplication `zbkb` | | [Zbkb][rv-zbkb] --- Bit Manipulation Instructions for Cryptography -`zbkc` | | [Zbkc][rv-zbc] --- Carry-less multiplication for Cryptography +`zbkc` | | [Zbkc][rv-zbkc] --- Carry-less multiplication for Cryptography `zbkx` | | [Zbkx][rv-zbkx] --- Crossbar permutations `zbs` | | [Zbs][rv-zbs] --- Single-bit instructions `zk` | `zkn`, `zkr`, `zks`, `zkt`, `zbkb`, `zbkc`, `zkbx` | [Zk][rv-zk] --- Scalar Cryptography From 0752505e48410b6abc479f7a25c8c6aabc895f3b Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Wed, 17 Sep 2025 02:34:09 +0000 Subject: [PATCH 4/5] RISC-V: Update implication from `zbc` rust-lang/rust#140139 changed the target feature implication without updating the Reference. That change is came from the fact that the Zbc extension is a functional superset of the Zbkc extension. This commit fixes this issue. Appendix - List of all Zbkc / Zbc instructions: * `clmul` (Zbkc / Zbc) * `clmulh` (Zbkc / Zbc) * `clmulr` (Zbc only) --- src/attributes/codegen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index acb22c852..50b32f6fb 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -506,7 +506,7 @@ Feature | Implicitly Enables | Description `m` | | [M][rv-m] --- Integer Multiplication and Division instructions `zba` | | [Zba][rv-zba] --- Address Generation instructions `zbb` | | [Zbb][rv-zbb] --- Basic bit-manipulation -`zbc` | | [Zbc][rv-zbc] --- Carry-less multiplication +`zbc` | `zbkc` | [Zbc][rv-zbc] --- Carry-less multiplication `zbkb` | | [Zbkb][rv-zbkb] --- Bit Manipulation Instructions for Cryptography `zbkc` | | [Zbkc][rv-zbkc] --- Carry-less multiplication for Cryptography `zbkx` | | [Zbkx][rv-zbkx] --- Crossbar permutations From 1adf4c7d603c878b612d971d07102abfa78ee7a7 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 28 Sep 2025 17:02:06 -0700 Subject: [PATCH 5/5] Use oxford comma --- src/attributes/codegen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 50b32f6fb..d472c4db0 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -493,7 +493,7 @@ On this platform the usage of `#[target_feature]` functions follows the Further documentation on these features can be found in their respective specification. Many specifications are described in the [RISC-V ISA Manual], -[version 20250508] or in another manual hosted on the [RISC-V GitHub Account]. +[version 20250508], or in another manual hosted on the [RISC-V GitHub Account]. [RISC-V ISA Manual]: https://github.com/riscv/riscv-isa-manual [version 20250508]: https://github.com/riscv/riscv-isa-manual/tree/20250508