rust/compiler/rustc_target/src
Matthias Krüger 31a72bc45c
Rollup merge of #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).
2025-04-24 17:19:44 +02:00
..
asm Rename is_like_osx to is_like_darwin 2025-03-25 21:53:52 +01:00
callconv mitigate MSVC unsoundness by not emitting alignment attributes on win32-msvc targets 2025-04-07 23:30:55 +02:00
spec Rollup merge of #139261 - RalfJung:msvc-align-mitigation, r=oli-obk 2025-04-24 11:40:35 +02:00
json.rs compiler: internally merge Conv::PtxKernel into GpuKernel 2025-02-09 23:14:55 -08:00
lib.rs refactor: Move Apple OSVersion (back) to rustc_target 2025-04-04 15:01:27 +02:00
target_features.rs Rollup merge of #140139 - a4lg:riscv-feature-imply-adjust-1, r=Amanieu 2025-04-24 17:19:44 +02:00
tests.rs Use serde_json for target spec json 2022-06-03 16:46:19 +00:00