Skip to content
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

Enable Aarch64 feature detection on all Apple/Darwin targets #1636

Merged
merged 1 commit into from
Sep 14, 2024
Merged
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: 2 additions & 2 deletions crates/std_detect/src/detect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ cfg_if! {
} else if #[cfg(all(target_os = "windows", any(target_arch = "aarch64", target_arch = "arm64ec")))] {
#[path = "os/windows/aarch64.rs"]
mod os;
} else if #[cfg(all(target_os = "macos", target_arch = "aarch64", feature = "libc"))] {
#[path = "os/macos/aarch64.rs"]
} else if #[cfg(all(target_vendor = "apple", target_arch = "aarch64", feature = "libc"))] {
#[path = "os/darwin/aarch64.rs"]
mod os;
} else {
#[path = "os/other.rs"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Run-time feature detection for aarch64 on macOS.
//! Run-time feature detection for aarch64 on Darwin (macOS/iOS/tvOS/watchOS/visionOS).
//!
//! <https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics>

use crate::detect::{cache, Feature};

Expand Down
4 changes: 2 additions & 2 deletions crates/std_detect/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ fn aarch64_bsd() {
}

#[test]
#[cfg(all(target_arch = "aarch64", target_os = "macos"))]
fn aarch64_macos() {
#[cfg(all(target_arch = "aarch64", target_vendor = "apple"))]
fn aarch64_darwin() {
println!("asimd: {:?}", is_aarch64_feature_detected!("asimd"));
println!("fp: {:?}", is_aarch64_feature_detected!("fp"));
println!("fp16: {:?}", is_aarch64_feature_detected!("fp16"));
Expand Down
4 changes: 2 additions & 2 deletions crates/stdarch-test/src/disassembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
let me = env::current_exe().expect("failed to get current exe");

let objdump = env::var("OBJDUMP").unwrap_or_else(|_| "objdump".to_string());
let add_args = if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") {
// Target features need to be enabled for LLVM objdump on Macos ARM64
let add_args = if cfg!(target_vendor = "apple") && cfg!(target_arch = "aarch64") {
// Target features need to be enabled for LLVM objdump on Darwin ARM64
vec!["--mattr=+v8.6a,+crypto,+tme"]
} else if cfg!(target_arch = "riscv64") {
vec!["--mattr=+zk,+zks,+zbc,+zbb"]
Expand Down
6 changes: 3 additions & 3 deletions triagebot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ resolved/implemented on Fuchsia. Could one of you weigh in please?
Thanks!
"""

[ping.macos]
[ping.apple]
alias = ["macos", "ios", "tvos", "watchos", "visionos"]
message = """\
Hey MacOS Group! This issue or PR could use some MacOS-specific guidance. Could
Hey Apple Group! This issue or PR could use some Darwin-specific guidance. Could
one of you weigh in please?
Thanks!
"""