Skip to content

Commit 90ec7ea

Browse files
committed
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.
1 parent adcb3d3 commit 90ec7ea

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

compiler/rustc_target/src/target_features.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
248248
("mte", Stable, &[]),
249249
// FEAT_AdvSimd & FEAT_FP
250250
("neon", Stable, &[]),
251+
// Backend option that we would like to `cfg` on in library, unstable since it
252+
// doesn't need to user-togglable.
253+
("outline-atomics", Unstable(sym::aarch64_unstable_target_feature), &[]),
251254
// FEAT_PAUTH (address authentication)
252255
("paca", Stable, &[]),
253256
// FEAT_PAUTH (generic authentication)

tests/assembly-llvm/asm/aarch64-outline-atomics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
use std::sync::atomic::AtomicI32;
99
use std::sync::atomic::Ordering::*;
1010

11+
// Verify config on outline-atomics works (it is always enabled on aarch64-linux).
12+
#[cfg(not(target_feature = "outline-atomics"))]
13+
compile_error!("outline-atomics is not enabled");
14+
1115
pub fn compare_exchange(a: &AtomicI32) {
1216
// On AArch64 LLVM should outline atomic operations.
1317
// CHECK: __aarch64_cas4_relax

0 commit comments

Comments
 (0)