diff options
| author | Makoto Kato <m_kato@ga2.so-net.ne.jp> | 2023-01-11 15:58:49 +0900 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2024-01-16 02:57:10 +0000 |
| commit | d51ea0d261392bc526004c09894155038bad131d (patch) | |
| tree | bcf7c8893f99d17d3dfb7e39bc745b1a86c4921a /library/stdarch/crates/std_detect/tests/cpu-detection.rs | |
| parent | c4a00026d41404e72489f1883eec1964dc16554a (diff) | |
| download | rust-d51ea0d261392bc526004c09894155038bad131d.tar.gz rust-d51ea0d261392bc526004c09894155038bad131d.zip | |
Add CPU detection for macOS/aarch64.
Diffstat (limited to 'library/stdarch/crates/std_detect/tests/cpu-detection.rs')
| -rw-r--r-- | library/stdarch/crates/std_detect/tests/cpu-detection.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/library/stdarch/crates/std_detect/tests/cpu-detection.rs b/library/stdarch/crates/std_detect/tests/cpu-detection.rs index cb57b849d69..1ad897a2e21 100644 --- a/library/stdarch/crates/std_detect/tests/cpu-detection.rs +++ b/library/stdarch/crates/std_detect/tests/cpu-detection.rs @@ -140,6 +140,38 @@ fn aarch64_bsd() { } #[test] +#[cfg(all(target_arch = "aarch64", target_os = "macos"))] +fn aarch64_macos() { + println!("asimd: {:?}", is_aarch64_feature_detected!("asimd")); + println!("fp: {:?}", is_aarch64_feature_detected!("fp")); + println!("fp16: {:?}", is_aarch64_feature_detected!("fp16")); + println!("pmull: {:?}", is_aarch64_feature_detected!("pmull")); + println!("crc: {:?}", is_aarch64_feature_detected!("crc")); + println!("lse: {:?}", is_aarch64_feature_detected!("lse")); + println!("lse2: {:?}", is_aarch64_feature_detected!("lse2")); + println!("rdm: {:?}", is_aarch64_feature_detected!("rdm")); + println!("rcpc: {:?}", is_aarch64_feature_detected!("rcpc")); + println!("rcpc2: {:?}", is_aarch64_feature_detected!("rcpc2")); + println!("dotprod: {:?}", is_aarch64_feature_detected!("dotprod")); + println!("fhm: {:?}", is_aarch64_feature_detected!("fhm")); + println!("flagm: {:?}", is_aarch64_feature_detected!("flagm")); + println!("ssbs: {:?}", is_aarch64_feature_detected!("ssbs")); + println!("sb: {:?}", is_aarch64_feature_detected!("sb")); + println!("paca: {:?}", is_aarch64_feature_detected!("paca")); + println!("dpb: {:?}", is_aarch64_feature_detected!("dpb")); + println!("dpb2: {:?}", is_aarch64_feature_detected!("dpb2")); + println!("frintts: {:?}", is_aarch64_feature_detected!("frintts")); + println!("i8mm: {:?}", is_aarch64_feature_detected!("i8mm")); + println!("bf16: {:?}", is_aarch64_feature_detected!("bf16")); + println!("bti: {:?}", is_aarch64_feature_detected!("bti")); + println!("fcma: {:?}", is_aarch64_feature_detected!("fcma")); + println!("jsconv: {:?}", is_aarch64_feature_detected!("jsconv")); + println!("aes: {:?}", is_aarch64_feature_detected!("aes")); + println!("sha2: {:?}", is_aarch64_feature_detected!("sha2")); + println!("sha3: {:?}", is_aarch64_feature_detected!("sha3")); +} + +#[test] #[cfg(all(target_arch = "powerpc", target_os = "linux"))] fn powerpc_linux() { println!("altivec: {}", is_powerpc_feature_detected!("altivec")); |
