Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a343dcb

Browse files
committedFeb 22, 2025
rustc_target: Add more RISC-V atomic-related features
1 parent 69482e8 commit a343dcb

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
 

‎compiler/rustc_codegen_llvm/src/llvm_util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
281281
("riscv32" | "riscv64", "zaamo") if get_version().0 < 19 => None,
282282
("riscv32" | "riscv64", "zabha") if get_version().0 < 19 => None,
283283
("riscv32" | "riscv64", "zalrsc") if get_version().0 < 19 => None,
284+
("riscv32" | "riscv64", "zama16b") if get_version().0 < 19 => None,
285+
("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None,
284286
// Enable the evex512 target feature if an avx512 target feature is enabled.
285287
("x86", s) if s.starts_with("avx512") => {
286288
Some(LLVMFeature::with_dependency(s, TargetFeatureFoldStrength::EnableOnly("evex512")))

‎compiler/rustc_target/src/target_features.rs

+5
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,14 @@ static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
497497
("relax", Unstable(sym::riscv_target_feature), &[]),
498498
("unaligned-scalar-mem", Unstable(sym::riscv_target_feature), &[]),
499499
("v", Unstable(sym::riscv_target_feature), &[]),
500+
("za128rs", Unstable(sym::riscv_target_feature), &[]),
501+
("za64rs", Unstable(sym::riscv_target_feature), &[]),
500502
("zaamo", Unstable(sym::riscv_target_feature), &[]),
501503
("zabha", Unstable(sym::riscv_target_feature), &["zaamo"]),
504+
("zacas", Unstable(sym::riscv_target_feature), &["zaamo"]),
502505
("zalrsc", Unstable(sym::riscv_target_feature), &[]),
506+
("zama16b", Unstable(sym::riscv_target_feature), &[]),
507+
("zawrs", Unstable(sym::riscv_target_feature), &[]),
503508
("zba", Stable, &[]),
504509
("zbb", Stable, &[]),
505510
("zbc", Stable, &[]),

‎tests/ui/check-cfg/target_feature.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,14 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
279279
`xsavec`
280280
`xsaveopt`
281281
`xsaves`
282+
`za128rs`
283+
`za64rs`
282284
`zaamo`
283285
`zabha`
286+
`zacas`
284287
`zalrsc`
288+
`zama16b`
289+
`zawrs`
285290
`zba`
286291
`zbb`
287292
`zbc`

0 commit comments

Comments
 (0)
Failed to load comments.