-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc_target: Adjust RISC-V feature implication #140139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+5
−5
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adjusts feature implication of the RISC-V ISA for better feature detection from the user perspective. The main rule is: If the feature A is a functional superset of the feature B (A ⊃ B), A is to imply B, even if this implication is not on the manual. Such implications (not directly referred in the ISA manual) are commented as "A ⊃ B" which means "A is a (functional) superset of B". 1. Zbc → Zbkc (add as a superset) The Zbkc extension is a subset of the Zbc extension (Zbc - "clmulr" instruction == Zbkc) 2. Zkr → (nothing) (remove dependency to Zicsr) Implication to the Zicsr extension is removed because (although nearly harmless), the Zkr extension (or the "seed" CSR section) defines its own subset of the Zicsr extension. 3. Zvbb → Zvkb (comment as a superset) This implication was already there but not denoted as a functional superset. This commit adds the comment. 4. Zvfh → Zvfhmin (comment as a superset) This is similar to the case above (Zvbb → Zvkb). 5. Zvfh → Zve32f (add implication per the ISA specification) This dependency is on the ISA manual but was missing (due to the fact that Zvfh indirectly implies Zve32f on the current implementation through Zvfh → Zvfhmin, which is a functional relation). This commit ensures that this is *also* ISA-compliant in the source code level (there's no functional changes though). 6. Zvknhb → Zvknha (add as a superset) The Zvknhb extension (SHA-256 / SHA-512) is a functional superset of the Zvknha extension (SHA-256 only).
taiki-e
reviewed
Apr 23, 2025
taiki-e
approved these changes
Apr 23, 2025
@bors r+ rollup |
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Apr 24, 2025
… r=Amanieu rustc_target: Adjust RISC-V feature implication This commit adjusts feature implication of the RISC-V ISA for better feature detection from the user perspective. The main rule is: * If the feature `A` is a functional superset of the feature `B` (`A ⊃ B`), `A` is to imply `B`, even if this implication is not on the manual. Such implications (not directly written in the ISA manual) are commented as `A ⊃ B` which means "`A` is a (functional) superset of `B`". 1. `Zbc` → `Zbkc` (add as a superset) The `Zbkc` extension is a subset of the `Zbc` extension (`Zbc` minus `clmulr` instruction). 2. `Zkr` → (nothing) (remove dependency to `Zicsr`) Implication to the `Zicsr` extension is removed because (although nearly harmless), the `Zkr` extension (or the `seed` CSR section) defines its own subset of the `Zicsr` extension (guaranteed to work against the `seed` CSR which needs read/write access). 3. `Zvbb` → `Zvkb` (comment as a superset) This implication was already there but not denoted as a functional superset. This commit adds the comment. 4. `Zvfh` → `Zvfhmin` (comment as a superset) This is similar to the case above (`Zvbb` → `Zvkb`). 5. `Zvfh` → `Zve32f` (add implication per the ISA specification) This dependency is on the ISA manual but was missing (due to the fact that `Zvfh` indirectly implies `Zve32f` on the current implementation through `Zvfh` → `Zvfhmin` which is a functional relation). This commit ensures that this is *also* ISA-compliant in the source code level (there's no functional changes though). 6. `Zvknhb` → `Zvknha` (add as a superset) The `Zvknhb` extension (SHA-256 / SHA-512) is a functional superset of the `Zvknha` extension (SHA-256 only).
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 24, 2025
Rollup of 23 pull requests Successful merges: - rust-lang#139261 (mitigate MSVC alignment issue on x86-32) - rust-lang#139307 (std: Add performance warnings to HashMap::get_disjoint_mut) - rust-lang#139700 (Autodiff flags) - rust-lang#139752 (set subsections_via_symbols for ld64 helper sections) - rust-lang#139809 (Don't warn about `v128` in wasm ABI transition) - rust-lang#139852 (StableMIR: Implement `CompilerInterface`) - rust-lang#139945 (Extend HIR to track the source and syntax of a lifetime) - rust-lang#140028 (`deref_patterns`: support string and byte string literals in explicit `deref!("...")` patterns) - rust-lang#140139 (rustc_target: Adjust RISC-V feature implication) - rust-lang#140143 (Move `sys::pal::os::Env` into `sys::env`) - rust-lang#140148 (CI: use aws codebuild for job dist-arm-linux) - rust-lang#140150 (fix MAX_EXP and MIN_EXP docs) - rust-lang#140172 (Make algebraic functions into `const fn` items.) - rust-lang#140177 ([compiletest] Parallelize test discovery) - rust-lang#140181 (Remove `synstructure::Structure::underscore_const` calls.) - rust-lang#140184 (Update doc of cygwin target) - rust-lang#140186 (Rename `compute_x` methods) - rust-lang#140187 ([AIX] Handle AIX dynamic library extensions within c-link-to-rust-dylib run-make test) - rust-lang#140191 (Remove git repository from git config) - rust-lang#140194 (minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes`) - rust-lang#140195 (triagebot: label minicore changes w/ `A-test-infra-minicore` and ping jieyouxu on changes) - rust-lang#140202 (Make #![feature(let_chains)] bootstrap conditional in compiler/) - rust-lang#140214 (Remove comment about handling non-global where bounds with corresponding projection) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 24, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136083 (Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc) - rust-lang#138282 (Add `#[repr(u128)]`/`#[repr(i128)]` enums to `improper_ctypes_definitions`) - rust-lang#139700 (Autodiff flags) - rust-lang#140139 (rustc_target: Adjust RISC-V feature implication) - rust-lang#140141 (Move zkVM constants into `sys::env_consts`) - rust-lang#140150 (fix MAX_EXP and MIN_EXP docs) - rust-lang#140172 (Make algebraic functions into `const fn` items.) - rust-lang#140191 (Remove git repository from git config) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 24, 2025
Rollup merge of rust-lang#140139 - a4lg:riscv-feature-imply-adjust-1, r=Amanieu rustc_target: Adjust RISC-V feature implication This commit adjusts feature implication of the RISC-V ISA for better feature detection from the user perspective. The main rule is: * If the feature `A` is a functional superset of the feature `B` (`A ⊃ B`), `A` is to imply `B`, even if this implication is not on the manual. Such implications (not directly written in the ISA manual) are commented as `A ⊃ B` which means "`A` is a (functional) superset of `B`". 1. `Zbc` → `Zbkc` (add as a superset) The `Zbkc` extension is a subset of the `Zbc` extension (`Zbc` minus `clmulr` instruction). 2. `Zkr` → (nothing) (remove dependency to `Zicsr`) Implication to the `Zicsr` extension is removed because (although nearly harmless), the `Zkr` extension (or the `seed` CSR section) defines its own subset of the `Zicsr` extension (guaranteed to work against the `seed` CSR which needs read/write access). 3. `Zvbb` → `Zvkb` (comment as a superset) This implication was already there but not denoted as a functional superset. This commit adds the comment. 4. `Zvfh` → `Zvfhmin` (comment as a superset) This is similar to the case above (`Zvbb` → `Zvkb`). 5. `Zvfh` → `Zve32f` (add implication per the ISA specification) This dependency is on the ISA manual but was missing (due to the fact that `Zvfh` indirectly implies `Zve32f` on the current implementation through `Zvfh` → `Zvfhmin` which is a functional relation). This commit ensures that this is *also* ISA-compliant in the source code level (there's no functional changes though). 6. `Zvknhb` → `Zvknha` (add as a superset) The `Zvknhb` extension (SHA-256 / SHA-512) is a functional superset of the `Zvknha` extension (SHA-256 only).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-target-feature
Area: Enabling/disabling target features like AVX, Neon, etc.
O-riscv
Target: RISC-V architecture
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
This commit adjusts feature implication of the RISC-V ISA for better feature detection from the user perspective.
The main rule is:
A
is a functional superset of the featureB
(A ⊃ B
),A
is to implyB
, even if this implication is not on the manual.Such implications (not directly written in the ISA manual) are commented as
A ⊃ B
which means "
A
is a (functional) superset ofB
".Zbc
→Zbkc
(add as a superset)The
Zbkc
extension is a subset of theZbc
extension (Zbc
minusclmulr
instruction).Zkr
→ (nothing) (remove dependency toZicsr
)Implication to the
Zicsr
extension is removed because (although nearly harmless), theZkr
extension (or theseed
CSR section) defines its own subset of theZicsr
extension (guaranteed to work against theseed
CSR which needs read/write access).Zvbb
→Zvkb
(comment as a superset)This implication was already there but not denoted as a functional superset. This commit adds the comment.
Zvfh
→Zvfhmin
(comment as a superset)This is similar to the case above (
Zvbb
→Zvkb
).Zvfh
→Zve32f
(add implication per the ISA specification)This dependency is on the ISA manual but was missing (due to the fact that
Zvfh
indirectly impliesZve32f
on the current implementation throughZvfh
→Zvfhmin
which is a functional relation). This commit ensures that this is also ISA-compliant in the source code level (there's no functional changes though).Zvknhb
→Zvknha
(add as a superset)The
Zvknhb
extension (SHA-256 / SHA-512) is a functional superset of theZvknha
extension (SHA-256 only).Related:
#[target_feature]
#44839(
riscv_target_feature
)riscv_hwprobe
-based feature detection on Linux / Android stdarch#1770(synchronized with
stdarch
's latest RISC-V implication logic)@rustbot r? @Amanieu
@rustbot label +T-compiler +O-riscv +A-target-feature