Skip to content

aarch64: Make outline-atomics a known target feature #144761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("mte", Stable, &[]),
// FEAT_AdvSimd & FEAT_FP
("neon", Stable, &[]),
// Backend option to turn atomic operations into an intrinsic call when `lse` is not known to be
// available, so the intrinsic can do runtime LSE feature detection rather than unconditionally
// using slower non-LSE operations. Unstable since it doesn't need to user-togglable.
("outline-atomics", Unstable(sym::aarch64_unstable_target_feature), &[]),
// FEAT_PAUTH (address authentication)
("paca", Stable, &[]),
// FEAT_PAUTH (generic authentication)
Expand Down
4 changes: 4 additions & 0 deletions tests/assembly-llvm/asm/aarch64-outline-atomics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
use std::sync::atomic::AtomicI32;
use std::sync::atomic::Ordering::*;

// Verify config on outline-atomics works (it is always enabled on aarch64-linux).
#[cfg(not(target_feature = "outline-atomics"))]
compile_error!("outline-atomics is not enabled");

pub fn compare_exchange(a: &AtomicI32) {
// On AArch64 LLVM should outline atomic operations.
// CHECK: __aarch64_cas4_relax
Expand Down
1 change: 1 addition & 0 deletions tests/ui/check-cfg/target_feature.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
`nnp-assist`
`nontrapping-fptoint`
`nvic`
`outline-atomics`
`paca`
`pacg`
`pan`
Expand Down
Loading