rustc_target: RISC-V: add base I
-related important extensions
#138823
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Of RISC-V features defined in stdarch, this commit adds ratified extensions satisfying following criteria:
I
extension and splitted thereafter (now ratified asI
+Zifencei
+Zicsr
+Zicntr
+Zihpm
) orZihintpause
) andThis is based on the latest ratified ISA Manuals (version 20240411).
LLVM Definitions:
Zifencei
Zicsr
Zicntr
Zihpm
Zihintpause
Additional (1):
One of those,
Zicsr
, is a dependency of many other ISA extensions and this commit adds correct dependencies toZicsr
exceptV
(due to ongoing PR #138742).Additional (2):
In RISC-V,
G
is an abbreviation of following extensions:I
M
A
F
D
Zicsr
(although implied byF
)Zifencei
and all targets with either "riscv32gc" or "riscv64gc" are updated accordingly.
This is the version 3.
Ztso
in the original proposal is removed on the PR version 2 due to the minimum LLVM version (non-experimentalZtso
requires LLVM 19 while minimum LLVM version of Rust is 18). This is not back in PR version 3 after noticing addingZtso
is possible by checking host LLVM version because PR version 3 introduces compiler target changes (and adding more extensions would complicate the problems; sorryZihintpause
).Related:
#[target_feature]
#44839(
riscv_target_feature
)(This PR can be a prerequisite of resolving a part of that tracking issue)
(Touches the same place and vector extensions depend on
Zicsr
)NOT Related but linked:
-Ctarget-feature
s must be restrained on RISCV #132618(This PR won't be blocked by this issue since none of those extensions do not change the ABI)
@rustbot r? @Amanieu
@rustbot label +T-compiler +O-riscv +A-target-feature