From c3870fe0760de6ad91ea01e329b1217b08bcb838 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 23 May 2026 17:31:36 -0700 Subject: [PATCH 1/2] Document RISC-V d, e, and f extensions These are being stabilized in https://github.com/rust-lang/rust/pull/156188 as cfg-only features. It is a little odd to list them here in the target_feature attribute section since they can't be used with the attribute, but I think it makes sense to keep things together. Perhaps in the future we may consider breaking these lists out into a separate section and rearrange things. --- src/attributes/codegen.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index b1a79f3edc..340034270e 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -324,6 +324,9 @@ r[attributes.codegen.target_feature.availability] The following is a list of the available feature names. +r[attributes.codegen.target_feature.cfg-only] +Target feature names marked as "(cfg only)" in this list may only be used with the [`target_feature`][cfg.target_feature] conditional compilation option, not with the `target_feature` attribute. + r[attributes.codegen.target_feature.x86] #### `x86` or `x86_64` @@ -568,6 +571,9 @@ Feature | Implicitly Enables | Description `a` | `zaamo`, `zalrsc` | [A][rv-a] --- Atomic instructions `b` | `zba`, `zbc`, `zbs` | [B][rv-b] --- Bit Manipulation instructions `c` | `zca` | [C][rv-c] --- Compressed instructions +`d` | `f` | [D][rv-d] --- [(cfg only)] Double-Precision Floating-Point +`e` | | [E][rv-e] --- [(cfg only)] Embedded Instruction Set with 16 GPRs +`f` | `zicsr` | [F][rv-f] --- [(cfg only)] Single-Precision Floating-Point `m` | | [M][rv-m] --- Integer Multiplication and Division instructions `za64rs` | `za128rs` | [Za64rs][rv-za64rs] --- Platform Behavior: Naturally aligned Reservation sets with ≦ 64 Bytes `za128rs` | | [Za128rs][rv-za128rs] --- Platform Behavior: Naturally aligned Reservation sets with ≦ 128 Bytes @@ -620,6 +626,9 @@ Feature | Implicitly Enables | Description [rv-a]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/a-st-ext.adoc [rv-b]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc [rv-c]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/c-st-ext.adoc +[rv-d]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/d-st-ext.adoc +[rv-e]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/rv32e.adoc +[rv-f]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/f-st-ext.adoc [rv-m]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/m-st-ext.adoc [rv-za64rs]: https://github.com/riscv/riscv-profiles/blob/rva23-rvb23-ratified/src/rva23-profile.adoc [rv-za128rs]: https://github.com/riscv/riscv-profiles/blob/v1.0/profiles.adoc @@ -902,6 +911,7 @@ If the address of the function is taken as a function pointer, the low bit of th - For `arm::a32` ("ARM"), it will be 0. - For `arm::t32` ("Thumb"), it will be 1. +[(cfg only)]: attributes.codegen.target_feature.cfg-only [`-C target-cpu`]: ../../rustc/codegen-options/index.html#target-cpu [`-C target-feature`]: ../../rustc/codegen-options/index.html#target-feature [`export_name`]: abi.export_name From 8ab3b4085722efce3beb34d5efb435aab6ed01fd Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 12 Sep 2026 16:37:35 +0200 Subject: [PATCH 2/2] take away e, and the cfg-only restriction --- src/attributes/codegen.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 340034270e..696e1dcd5d 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -324,9 +324,6 @@ r[attributes.codegen.target_feature.availability] The following is a list of the available feature names. -r[attributes.codegen.target_feature.cfg-only] -Target feature names marked as "(cfg only)" in this list may only be used with the [`target_feature`][cfg.target_feature] conditional compilation option, not with the `target_feature` attribute. - r[attributes.codegen.target_feature.x86] #### `x86` or `x86_64` @@ -571,9 +568,8 @@ Feature | Implicitly Enables | Description `a` | `zaamo`, `zalrsc` | [A][rv-a] --- Atomic instructions `b` | `zba`, `zbc`, `zbs` | [B][rv-b] --- Bit Manipulation instructions `c` | `zca` | [C][rv-c] --- Compressed instructions -`d` | `f` | [D][rv-d] --- [(cfg only)] Double-Precision Floating-Point -`e` | | [E][rv-e] --- [(cfg only)] Embedded Instruction Set with 16 GPRs -`f` | `zicsr` | [F][rv-f] --- [(cfg only)] Single-Precision Floating-Point +`d` | `f` | [D][rv-d] --- Double-Precision Floating-Point +`f` | `zicsr` | [F][rv-f] --- Single-Precision Floating-Point `m` | | [M][rv-m] --- Integer Multiplication and Division instructions `za64rs` | `za128rs` | [Za64rs][rv-za64rs] --- Platform Behavior: Naturally aligned Reservation sets with ≦ 64 Bytes `za128rs` | | [Za128rs][rv-za128rs] --- Platform Behavior: Naturally aligned Reservation sets with ≦ 128 Bytes @@ -627,7 +623,6 @@ Feature | Implicitly Enables | Description [rv-b]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/b-st-ext.adoc [rv-c]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/c-st-ext.adoc [rv-d]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/d-st-ext.adoc -[rv-e]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/rv32e.adoc [rv-f]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/f-st-ext.adoc [rv-m]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/m-st-ext.adoc [rv-za64rs]: https://github.com/riscv/riscv-profiles/blob/rva23-rvb23-ratified/src/rva23-profile.adoc @@ -911,7 +906,6 @@ If the address of the function is taken as a function pointer, the low bit of th - For `arm::a32` ("ARM"), it will be 0. - For `arm::t32` ("Thumb"), it will be 1. -[(cfg only)]: attributes.codegen.target_feature.cfg-only [`-C target-cpu`]: ../../rustc/codegen-options/index.html#target-cpu [`-C target-feature`]: ../../rustc/codegen-options/index.html#target-feature [`export_name`]: abi.export_name