about summary refs log tree commit diff
path: root/compiler/rustc_target/src/target_features.rs
AgeCommit message (Collapse)AuthorLines
2025-09-10s390x: mark soft-float target feature as incompatibleRalf Jung-0/+8
2025-08-26Rollup merge of #145076 - ZhongyaoChen:feature/add-tier3-riscv64a23-target, ↵Guillaume Gomez-0/+43
r=davidtwco Add new Tier-3 target: riscv64a23-unknown-linux-gnu MCP: [Tier 3 target proposal: riscv64a23-unknown-linux-gnu](https://github.com/rust-lang/compiler-team/issues/894) Changes: - add new target: riscv64a23-unknown-linux-gnu - add target page
2025-08-19Rollup merge of #145099 - heiher:loong-32s, r=folkertdev许杰友 Jieyou Xu (Joe)-0/+1
rustc_target: Add the `32s` target feature for LoongArch LLVM: https://github.com/llvm/llvm-project/pull/139695
2025-08-19completely remove rva23s64Zhongyao Chen-70/+0
2025-08-14Auto merge of #144542 - sayantn:stabilize-sse4a-tbm, r=Amanieu,traviscrossbors-2/+2
Stabilize `sse4a` and `tbm` target features This PR stabilizes the feature flag `sse4a_target_feature` and `tbm_target_feature` (tracking issue rust-lang/rust#44839). # Public API The 2 `x86` target features `sse4a` and `tbm` Also, these were added in LLVM2.6 and LLVM3.4-rc1, respectively, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now. The intrinsics were stabilized *long* ago, in 1.27.0 Reference PR: - https://github.com/rust-lang/reference/pull/1949 cc `@rust-lang/lang` `@rustbot` label I-lang-nominated r? lang
2025-08-14Stabilize `sse4a` and `tbm` target featuressayantn-2/+2
- remove some stabilized target features from `gate.rs`
2025-08-13Rollup merge of #144761 - tgross35:cfg-outline-atomics, r=davidtwcoGuillaume Gomez-0/+4
aarch64: Make `outline-atomics` a known target feature This is a feature used by LLVM that is enabled for our `aarch64-linux` targets, which we would like to configure on in `std`. Thus, mark `outline-atomics` a known feature. It is left unstable for now.
2025-08-11Add new Tier-3 target: riscv64a23-unknown-linux-gnuChen Zhongyao-0/+113
2025-08-09rustc_target: Add the `32s` target feature for LoongArchWANG Rui-0/+1
2025-08-07Rollup merge of #138689 - jedbrown:jed/nvptx-target-feature, r=ZuseZ4Stuart Cook-1/+68
add nvptx_target_feature Tracking issue: #141468 (nvptx), which is part of #44839 (catch-all arches) The feature gate is `#![feature(nvptx_target_feature)]` This exposes the target features `sm_20` through `sm_120a` [as defined](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.1/llvm/lib/Target/NVPTX/NVPTX.td#L59-L85) by LLVM. Cc: ``````@gonzalobg`````` ``````@rustbot`````` label +O-NVPTX +A-target-feature
2025-07-31aarch64: Make `outline-atomics` a known target featureTrevor Gross-0/+4
This is a feature used by LLVM that is enabled for our `aarch64-linux` targets, which we would like to configure on in `std`. Thus, mark `outline-atomics` a known feature. It is left unstable for now.
2025-06-25make `tidy-alphabetical` use a natural sortFolkert de Vries-24/+24
2025-06-21add nvptx_target_featureJed Brown-1/+68
Add target features for sm_* and ptx*, both of which form a partial order, but cannot be combined to a single partial order. These mirror the LLVM target features, but we do not provide LLVM target processors (which imply both an sm_* and ptx* feature). Add some documentation for the nvptx target.
2025-06-19various minor target feature cleanupsRalf Jung-16/+4
2025-06-19line-wrap and extend comments, typosRalf Jung-0/+1
2025-06-19move -Ctarget-feature handling into shared codeRalf Jung-16/+14
2025-06-13Rollup merge of #135927 - azhogin:azhogin/retpoline, r=davidtwcoMatthias Krüger-10/+29
retpoline and retpoline-external-thunk flags (target modifiers) to enable retpoline-related target features `-Zretpoline` and `-Zretpoline-external-thunk` flags are target modifiers (tracked to be equal in linked crates). * Enables target features for `-Zretpoline-external-thunk`: `+retpoline-external-thunk`, `+retpoline-indirect-branches`, `+retpoline-indirect-calls`. * Enables target features for `-Zretpoline`: `+retpoline-indirect-branches`, `+retpoline-indirect-calls`. It corresponds to clang -mretpoline & -mretpoline-external-thunk flags. Also this PR forbids to specify those target features manually (warning). Issue: rust-lang/rust#116852
2025-06-10Rollup merge of #140766 - sayantn:stabilize-keylocker, r=traviscross,tgross35León Orell Valerian Liehr-2/+2
Stabilize keylocker This PR stabilizes the feature flag `keylocker_x86` (tracking issue rust-lang/rust#134813). # Public API The 2 `x86` target features `kl` and `widekl`, and the associated intrinsics in stdarch. These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 11 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update. Also, these were added way back in LLVM12, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! # Associated PRs - rust-lang/rust#134814 - rust-lang/stdarch#1706 - rust-lang/rust#136831 (stdarch submodule update) - rust-lang/stdarch#1795 (stabilizing the runtime detection and intrinsics) - rust-lang/rust#141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics) As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now. cc ````@rust-lang/lang```` cc ````@rust-lang/libs-api```` for the intrinsics and runtime detection I don't think anyone else worked on this feature, so no one else to ping, maybe cc ````@Amanieu.```` I will send the reference pr soon.
2025-06-09Rollup merge of #140767 - sayantn:stabilize-sha512, r=traviscross,tgross35Trevor Gross-3/+3
Stabilize `sha512`, `sm3` and `sm4` for x86 This PR stabilizes the feature flag `sha512_sm_x86` (tracking issue rust-lang/rust#126624). # Public API The 3 `x86` target features `sha512`, `sm3` and `sm4`, and the associated intrinsics in stdarch. These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 10 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update. Also, these were added in LLVM17, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! # Associated PRs - rust-lang/rust#126704 - rust-lang/stdarch#1592 - rust-lang/stdarch#1790 - rust-lang/rust#140389 (stdarch submodule update) - rust-lang/stdarch#1796 (stabilizing the runtime detection and intrinsics) - rust-lang/rust#141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics) As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now. cc `@rust-lang/lang` cc `@rust-lang/libs-api` for the intrinsics and runtime detection I don't think anyone else worked on this feature, so no one else to ping, maybe cc `@Amanieu.` I will send the reference pr soon.
2025-06-09-Zretpoline and -Zretpoline-external-thunk flags (target modifiers) to ↵Andrew Zhogin-10/+29
enable retpoline-related target features
2025-06-07Stabilize `sha512_sm_x86`, and the `sha512`, `sm3` and `sm4` target featuressayantn-3/+3
2025-06-07Stabilize the `keylocker_x86` flag, and the `kl` and `widekl` target featuressayantn-2/+2
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-3/+3
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-04Rollup merge of #141250 - folkertdev:s390x-z17-target-features, r=workingjubileeMatthias Krüger-10/+16
add s390x z17 target features tracking issue: https://github.com/rust-lang/rust/issues/130869 earlier target features were added in https://github.com/rust-lang/rust/pull/135630, and https://github.com/rust-lang/rust/issues/135413#issuecomment-2886439455 has some extra context on these new features. r? ``@ghost`` cc ``@uweigand``
2025-05-22aarch64-softfloat: forbid enabling the neon target featureRalf Jung-5/+7
2025-05-19add s390x z17 target featuresFolkert de Vries-10/+16
2025-05-18Stabilize `avx512_target_feature`sayantn-22/+22
2025-05-09Partially stabilize LoongArch target featuresWANG Rui-7/+7
2025-05-06Added `apxf` target feature support, under flag `apx_target_feature`Madhav Madhusoodanan-0/+1
2025-05-04Rollup merge of #139675 - sayantn:avx10, r=AmanieuStuart Cook-0/+20
Add the AVX10 target features Parent #138843 Adds the `avx10_target_feature` feature gate, and `avx10.1` and `avx10.2` target features. It is confirmed that Intel is dropping AVX10/256 (see [this comment](https://github.com/rust-lang/rust/issues/111137#issuecomment-2795442288)), so this should be safe to implement now. The LLVM fix for llvm/llvm-project#135394 was merged, and has been backported to LLVM20, and the patch has also been propagated to rustc in #140502 `@rustbot` label O-x86_64 O-x86_32 A-target-feature A-SIMD
2025-05-02Rollup merge of #140507 - a4lg:riscv-feature-addition-batch-3, r=AmanieuStuart Cook-1/+11
rustc_target: RISC-V: feature addition batch 3 This is the last batch (3 of 3) for RISC-V feature enhancements intended for the version 1.88 cycle. The author's primary criteria are: 1. The extension is ratified and unprivileged one. 2. The extension is in the RVA23U64 profile (to be a baseline of the application-class RISC-V software ecosystem in the near future), either mandatory or optional. 3. Either: 1. To be discoverable through a `riscv_hwprobe` system call on (currently unreleased) Linux 6.15 (as of rc4) or 2. Helps memory/atomics-related operations more efficient and/or more robust. This is based on the specifications: * [The latest ratified ISA Manuals (version 20240411)](https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications) * [RVA23/RVB23 profiles](https://github.com/riscv/riscv-profiles/releases/tag/rva23-rvb23-ratified) * [RISC-V BF16 extensions](https://github.com/riscv/riscv-bfloat16/releases/tag/v183a3dac863d7c18187a739eb52b0c8f0d16854d) LLVM Definitions: * [`Zicbop`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L82-87) * [`Zicbom`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L75-L80) * [`Zic64b`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L71-L73) * [`Ziccamoa`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L97-L99) * [`Ziccif`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L101-L103) * [`Zicclsm`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L105-L107) * [`Ziccrse`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L109-L111) * [`Zfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L320-L325) * [`Zvfbfmin`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L697-L702) * [`Zvfbfwma`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L704-L710) The `Zicbop` extension (mandatory in RVA23U64) adds prefetch hints to prepare for subsequent memory operations (will be executed as no-op if the hardware does not support this extension). The `Zicbom` extension (mandatory in RVA23U64) adds cache block-management instructions. The author did not include this in the batch 2 (because of limited use cases compared to the `Zicboz` extension) but added because it will be discoverable from Linux (as of version 6.15-rc4). Along with `Zicbop`, Rust now supports all CMO extensions. The `Zic64b` extension (mandatory in RVA23U64) constraints the cache block to be naturally-aligned and exactly 64 bytes. Along with CMO instructions, it can improve efficiency handling with memory (e.g. efficient memory zeroing using `Zicboz` + `Zic64b`). The `Zicc*` extensions (mandatory in RVA23U64) add constraints to the main memory properties. They are normally satisfied in the application environment with regular OSes but profiles like RVA23U64 ensures such properties are satisfied (through those *constraint* extensions). The `Zfbf*` and `Zvfbf*` extensions (optional in RVA23U64) add instructions to handle BF16 (BFloat16) data. Although stabilization of FP-related extensions are relatively far due to ABI-related issues, they are included in this batch because they will be discoverable from Linux (as of version 6.15-rc4). The author also adds the extension implication: `Za64rs` → `Za128rs` (superset) which the author missed to include in #140139.
2025-05-02Rollup merge of #140389 - sayantn:avx512fp16, r=AmanieuStuart Cook-1/+1
Remove `avx512dq` and `avx512vl` implication for `avx512fp16` According to Intel, `avx512fp16` requires only `avx512bw`, but LLVM also enables `avx512vl` and `avx512dq` when `avx512fp16` is active. This is relic code, and will be fixed in LLVM soon. We should remove this from Rust too asap, especially before the stabilization of AVX512 Related: - llvm/llvm-project#136209 - #138940 - rust-lang/stdarch#1781 - #111137 ``@rustbot`` label O-x86_64 O-x86_32 A-SIMD A-target-feature T-compiler -T-libs r? ``@Amanieu`` **Update: the LLVM fix has been merged** cc ``@rust-lang/wg-llvm`` will it be possible to update the rustc llvm version to something after llvm/llvm-project#137450
2025-05-02Rollup merge of #138872 - a4lg:riscv-fix-incompatible-abi-zfinx, ↵Stuart Cook-4/+4
r=workingjubilee rustc_target: RISC-V `Zfinx` is incompatible with `{ILP32,LP64}[FD]` ABIs Because RISC-V Calling Conventions note that: > This means code targeting the `Zfinx` extension always uses the ILP32, ILP32E or LP64 integer calling-convention only ABIs as there is no dedicated hardware floating-point register file. `{ILP32,LP64}[FD]` ABIs with hardware floating-point calling conventions are incompatible with the `Zfinx` extension. This commit adds `"zfinx"` to the incompatible feature list to those ABIs and tests whether trying to add `"zdinx"` (that is analogous to `"zfinx"` but in double-precision) on a LP64D ABI configuration results in an error (it also tests extension implication; `Zdinx` requires `Zfinx` extension). Links: RISC-V psABI specification version 1.0 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/v1.0/riscv-cc.adoc#named-abis> <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-01rustc_target: RISC-V "Zfinx" is incompatible with {ILP32,LP64}[FD] ABIsTsukasa OI-4/+4
Because RISC-V Calling Conventions note that: > This means code targeting the Zfinx extension always uses the ILP32, > ILP32E or LP64 integer calling-convention only ABIs as there is no > dedicated hardware floating-point register file. {ILP32,LP64}[FD] ABIs with hardware floating-point calling conventions are incompatible with the "Zfinx" extension. This commit adds "zfinx" to the incompatible feature list to those ABIs and tests whether trying to add "zdinx" (that is analogous to "zfinx" but in double-precision) on a LP64D ABI configuration results in an error (it also tests extension implication; "Zdinx" requires "Zfinx" extension). Link: RISC-V psABI specification version 1.0 <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/tag/v1.0>
2025-05-01rustc_target: RISC-V: Add BF16 extensionsTsukasa OI-0/+3
This commit adds three ratified unprivileged RISC-V extensions related to BFloat16 (BF16) handling. Although that they are far from stabilization due to ABI issues, they are optional extensions of the RVA23U64 profile (application-class processor profile) and going to be discoverable from the Linux kernel (as of version 6.15-rc4). This commit mainly prepares runtime detection of those extensions.
2025-05-01rustc_target: RISC-V: Add atomics/memory-related extensionsTsukasa OI-0/+7
This commit adds a part of RISC-V extensions that are mandatory part of the RVA23U64 profile (application-class processor profile) and related to memory/atomic constraints. The Zic64b extension constrains the cache line to naturally-aligned 64 bytes that would make certain memory operations (like zeroing the memory using the Zicboz extension) easier. The Zicbom and Zicbop extensions enable managing cache block-based operations (the Zicbop contains hints that will work as a NOP when this extension is absent and the Zicbom contains control instructions). Of which, the Zicbom extension is going to be discoverable from the Linux kernel (as of the version 6.15-rc4) and this commit prepares for corresponding stdarch changes. The Zicc* extensions add certain constraints to "the main memory" (usually true on the user mode application on the application-class processor but those extensions make sure such constraints exist).
2025-05-01rustc_target: Adjust RISC-V feature implication (Za64rs and Za128rs)Tsukasa OI-1/+1
The Za64rs extension (reservation set -- a primitive memory unit of LR/SC atomic operations -- is naturally aligned and *at most* 64 bytes) is a superset of the Za128rs extension (*at most* 128 bytes; note that smaller the reservation set is, more fine grained control over atomics). This commit handles this as a feature implication.
2025-05-01Remove `avx512dq` and `avx512vl` implication for `avx512fp16`Sayantan Chakraborty-1/+1
2025-04-29Add comment to remind filtering unsupported features when adding new onesWANG Rui-0/+3
2025-04-26Add the `avx10.1` and `avx10.2` target featuressayantn-0/+20
2025-04-24Rollup merge of #140139 - a4lg:riscv-feature-imply-adjust-1, r=AmanieuMatthias Krüger-5/+5
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-22rustc_target: Adjust RISC-V feature implicationTsukasa OI-5/+5
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).
2025-04-20make abi_unsupported_vector_types a hard errorRalf Jung-1/+1
2025-04-16rustc_target: RISC-V: feature addition batch 2Tsukasa OI-1/+11
This commit adds unprivileged ratified extensions that are either dicoverable from the `riscv_hwprobe` syscall of the Linux kernel (as of version 6.14) plus 1 minus 3 extensions. Plus 1: * "B" This is a combination of "Zba", "Zbb" and "Zbs". Note: Although not required by the RISC-V specification, it is convenient to imply "B" from its three members (will be implemented in LLVM 21/22) but this is not yet implemented in Rust due to current implication handling. It still implies three members *from* "B". Minus 2: * "Zcf" (target_arch = "riscv32" only) This is the compression instruction subset corresponding "F". This is implied from RV32 + "C" + "F" but this complex handling is not yet supported by Rust's feature handling. * "Zcd" This is the compression instruction subset corresponding "D". This is implied from "C" + "D" but this complex handling is not yet supported by Rust's feature handling. * "Supm" Unlike regular RISC-V extensions, "Supm" and "Sspm" extensions do not provide any specific architectural features / constraints but requires *some* mechanisms to control pointer masking for the current mode. For instance, reported existence of the "Supm" extension in Linux means that `prctl` system call to control pointer masking is available and there are alternative ways to detect the existence. Notes: * Because this commit adds the "Zca" extension (an integer subset of the "C" extension), the "C" extension is modified to imply "Zca".
2025-04-02Rollup merge of #138823 - a4lg:riscv-feature-addition-base-i, r=AmanieuStuart Cook-4/+9
rustc_target: RISC-V: add base `I`-related important extensions Of ratified RISC-V features defined, this commit adds extensions satisfying following criteria: * Formerly a part of the `I` extension and splitted thereafter (now ratified as `I` + `Zifencei` + `Zicsr` + `Zicntr` + `Zihpm`) or * Dicoverable from newer versions of the Linux kernel and implemented as a part of `std_detect`'s feature (`Zihintpause`) and * Available on LLVM 18. This is based on [the latest ratified ISA Manuals (version 20240411)](https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications). LLVM Definitions: * [`Zifencei`](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L133-L137) * [`Zicsr`](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L116-L120) * [`Zicntr`](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L122-L124) * [`Zihpm`](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L153-L155) * [`Zihintpause`](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L139-L144) Additional (1): One of those, `Zicsr`, is a dependency of many other ISA extensions and this commit adds correct dependencies to `Zicsr`. Additional (2): In RISC-V, `G` is an abbreviation of following extensions: * `I` * `M` * `A` * `F` * `D` * `Zicsr` (although implied by `F`) * `Zifencei` and all RISC-V targets with the `G` abbreviation and targets for Android / VxWorks are updated accordingly. Note: Android will require RVA22 (likely RVA22U64) and some more extensions, which is a superset of RV64GC. For VxWorks, all BSPs currently distributed by Wind River are for boards with RV64GC (this commit also updates `riscv32-wrs-vxworks` though). -------- This is the version 4. `Ztso` in the original proposal is removed on the PR version 2 due to the minimum LLVM version (non-experimental `Ztso` requires LLVM 19 while minimum LLVM version of Rust is 18). This is not back in PR version 3 and 4 after noticing adding `Ztso` is possible by checking host LLVM version because PR version 3 introduces compiler target changes (and adding more extensions would complicate the problems; sorry `Zihintpause`). Version 4: * Fixed some commit messages, * Added Android / VxWorks targets to imply `G` and * Added an implication from `Zve32x` to `Zicsr` (which makes all vector extension subsets to imply `Zicsr`) since #138742 is now merged. Related: * #44839 (`riscv_target_feature`) * #114544 (This PR can be a prerequisite of resolving a part of that tracking issue) * #138742 (Touches the same place and vector extensions depend on `Zicsr`) NOT Related but linked: * #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
2025-04-02Rollup merge of #138003 - sayantn:new-amx, r=AmanieuStuart Cook-0/+6
Add the new `amx` target features and the `movrs` target feature Adds 5 new `amx` target features included in LLVM20. These are guarded under `x86_amx_intrinsics` (#126622) - `amx-avx512` - `amx-fp8` - `amx-movrs` - `amx-tf32` - `amx-transpose` Adds the `movrs` target feature (from #137976). `@rustbot` label O-x86_64 O-x86_32 T-compiler A-target-feature r? `@Amanieu`
2025-04-02rustc_target: RISC-V: add base "I"-related important extensionsTsukasa OI-4/+9
Of ratified RISC-V features defined, this commit adds extensions satisfying following criteria: * Formerly a part of the "I" extension and splitted thereafter (now ratified as "I" + "Zifencei" + "Zicsr" + "Zicntr" + "Zihpm") or * Dicoverable from newer versions of the Linux kernel and implemented as a part of std_detect's feature ("Zihintpause"). This is based on the latest ratified ISA Manuals (version 20240411). Additional (1): One of those, "Zicsr", is a dependency of many other ISA extensions and this commit adds correct dependencies to "Zicsr". Additional (2): In RISC-V, "G" is an abbreviation of following extensions: * "I" * "M" * "A" * "F" * "D" * "Zicsr" (although implied by "F") * "Zifencei" and all RISC-V targets with the "G" abbreviation and targets for Android / VxWorks are updated accordingly. Note: Android will require RVA22 (likely RVA22U64) and some more extensions, which is a superset of RV64GC. For VxWorks, all BSPs currently distributed by Wind River are for boards with RV64GC (this commit also updates riscv32-wrs-vxworks though).
2025-03-20rustc_target: Use zvl*b target features in vector ABI checkTaiki Endo-2/+14
2025-03-20rustc_target: Add more RISC-V vector-related featuresTaiki Endo-1/+37
2025-03-17rustc_target: Add target feature constraints for LoongArchWANG Rui-0/+22
Part of https://github.com/rust-lang/rust/issues/116344