Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/attributes/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,18 @@ Feature | Implicitly Enables | Description
`zkt` | | [Zkt][rv-zkt] --- Data Independent Execution Latency Subset
`ztso` | | [Ztso][rv-ztso] --- Total Store Ordering


r[attributes.codegen.target_feature.riscv.misa]
Some RISC-V targets implement the [Machine ISA] (`misa`) register. Whether a single-letter extension (`A`, `B`, ...) is present can be queried from the corresponding bit of this register.
The RISC-V specification allows implementations to have a writable `misa` and change the set of supported extensions at runtime.

Rust code compiled with a single-letter target feature requires the feature to be available during execution and enabled in the `misa` register, if applicable.
It is [undefined behaviour][ub-target-feature] to violate this requirement.


[Machine ISA]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/machine.adoc#machine-isa-misa-register
[ub-target-feature]: undefined.target-feature

<!-- Keep links near each table to make it easier to move and update. -->

[rv-a]: https://github.com/riscv/riscv-isa-manual/blob/20250508/src/a-st-ext.adoc
Expand Down
Loading