diff options
| author | Taiki Endo <te316e89@gmail.com> | 2025-02-22 16:15:14 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2025-02-22 16:15:14 +0900 |
| commit | a343dcb97fc37a54083963cc29bfb34f6ace1ddf (patch) | |
| tree | bf4cb791057500a035711d7731799332cb376a17 | |
| parent | 69482e8e5a5fa1441615b015ac2f59178d944696 (diff) | |
| download | rust-a343dcb97fc37a54083963cc29bfb34f6ace1ddf.tar.gz rust-a343dcb97fc37a54083963cc29bfb34f6ace1ddf.zip | |
rustc_target: Add more RISC-V atomic-related features
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_target/src/target_features.rs | 5 | ||||
| -rw-r--r-- | tests/ui/check-cfg/target_feature.stderr | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index b4b5d6a5b19..1fcb20e0d7b 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -281,6 +281,8 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea ("riscv32" | "riscv64", "zaamo") if get_version().0 < 19 => None, ("riscv32" | "riscv64", "zabha") if get_version().0 < 19 => None, ("riscv32" | "riscv64", "zalrsc") if get_version().0 < 19 => None, + ("riscv32" | "riscv64", "zama16b") if get_version().0 < 19 => None, + ("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None, // Enable the evex512 target feature if an avx512 target feature is enabled. ("x86", s) if s.starts_with("avx512") => { Some(LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512"))) diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index 1ba8defedae..87dd54e7f3d 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -497,9 +497,14 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ ("relax", Unstable(sym::riscv_target_feature), &[]), ("unaligned-scalar-mem", Unstable(sym::riscv_target_feature), &[]), ("v", Unstable(sym::riscv_target_feature), &[]), + ("za128rs", Unstable(sym::riscv_target_feature), &[]), + ("za64rs", Unstable(sym::riscv_target_feature), &[]), ("zaamo", Unstable(sym::riscv_target_feature), &[]), ("zabha", Unstable(sym::riscv_target_feature), &["zaamo"]), + ("zacas", Unstable(sym::riscv_target_feature), &["zaamo"]), ("zalrsc", Unstable(sym::riscv_target_feature), &[]), + ("zama16b", Unstable(sym::riscv_target_feature), &[]), + ("zawrs", Unstable(sym::riscv_target_feature), &[]), ("zba", Stable, &[]), ("zbb", Stable, &[]), ("zbc", Stable, &[]), diff --git a/tests/ui/check-cfg/target_feature.stderr b/tests/ui/check-cfg/target_feature.stderr index 70852423bdb..9e9bd391429 100644 --- a/tests/ui/check-cfg/target_feature.stderr +++ b/tests/ui/check-cfg/target_feature.stderr @@ -279,9 +279,14 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE"); `xsavec` `xsaveopt` `xsaves` +`za128rs` +`za64rs` `zaamo` `zabha` +`zacas` `zalrsc` +`zama16b` +`zawrs` `zba` `zbb` `zbc` |
