Skip to content

Commit e789f3a

Browse files
committed
Auto merge of #90271 - adamgemmell:dev/feat-detect-stabilise, r=Amanieu
Stabilise `is_aarch64_feature_detected!` under `simd_aarch64` feature Initial implementation, looking for feedback on the approach here. #86941 One point I noticed was that I haven't seen different "since" versions for the same feature - does this mean that other features can't be added to to the `simd_aarch64` feature once this is in stable? If so it might need a more specific name. r? `@Amanieu`
2 parents 6499c5e + 93b5bfb commit e789f3a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

library/std/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,14 @@ pub mod arch {
546546
#[doc(no_inline)] // Note (#82861): required for correct documentation
547547
pub use core::arch::*;
548548

549+
#[stable(feature = "simd_aarch64", since = "1.60.0")]
550+
pub use std_detect::is_aarch64_feature_detected;
549551
#[stable(feature = "simd_x86", since = "1.27.0")]
550552
pub use std_detect::is_x86_feature_detected;
551553
#[unstable(feature = "stdsimd", issue = "48556")]
552554
pub use std_detect::{
553-
is_aarch64_feature_detected, is_arm_feature_detected, is_mips64_feature_detected,
554-
is_mips_feature_detected, is_powerpc64_feature_detected, is_powerpc_feature_detected,
555-
is_riscv_feature_detected,
555+
is_arm_feature_detected, is_mips64_feature_detected, is_mips_feature_detected,
556+
is_powerpc64_feature_detected, is_powerpc_feature_detected, is_riscv_feature_detected,
556557
};
557558
}
558559

library/std/tests/run-time-detect.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
#![cfg_attr(
44
any(
55
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
6-
all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
6+
all(bootstrap, target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
77
all(target_arch = "powerpc", target_os = "linux"),
88
all(target_arch = "powerpc64", target_os = "linux"),
9-
any(target_arch = "x86", target_arch = "x86_64"),
109
),
1110
feature(stdsimd)
1211
)]
@@ -46,7 +45,8 @@ fn aarch64_linux() {
4645
println!("flagm: {}", is_aarch64_feature_detected!("flagm"));
4746
println!("ssbs: {}", is_aarch64_feature_detected!("ssbs"));
4847
println!("sb: {}", is_aarch64_feature_detected!("sb"));
49-
println!("pauth: {}", is_aarch64_feature_detected!("pauth"));
48+
println!("paca: {}", is_aarch64_feature_detected!("paca"));
49+
println!("pacg: {}", is_aarch64_feature_detected!("pacg"));
5050
println!("dpb: {}", is_aarch64_feature_detected!("dpb"));
5151
println!("dpb2: {}", is_aarch64_feature_detected!("dpb2"));
5252
println!("sve2: {}", is_aarch64_feature_detected!("sve2"));

0 commit comments

Comments
 (0)