about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect/tests/cpu-detection.rs
diff options
context:
space:
mode:
authorKajetan Puchalski <kajetan.puchalski@arm.com>2024-06-17 14:25:16 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2024-07-25 15:18:37 +0100
commitef538bc614a9c4e2c5730400576d53136ea2080a (patch)
treedfe6904badb423db8e649976357dc28323b270d0 /library/stdarch/crates/std_detect/tests/cpu-detection.rs
parentdfc5dfc8ef80587aef07c6a51014de724b779c8e (diff)
downloadrust-ef538bc614a9c4e2c5730400576d53136ea2080a.tar.gz
rust-ef538bc614a9c4e2c5730400576d53136ea2080a.zip
std_detect: Add aarch64/linux/LLVM SME features
Add detection for SME features supported by LLVM and the Linux Kernel.
Include commented-out hwcap fields for features supported by Linux but not by LLVM.

This commit adds feature detection for the following features:

- FEAT_SME
- FEAT_SME_F16F16
- FEAT_SME_F64F64
- FEAT_SME_F8F16
- FEAT_SME_F8F32
- FEAT_SME_FA64
- FEAT_SME_I16I64
- FEAT_SME_LUTv2
- FEAT_SME2
- FEAT_SME2p1
- FEAT_SSVE_FP8DOT2
- FEAT_SSVE_FP8DOT4
- FEAT_SSVE_FP8FMA

Linux features: https://github.com/torvalds/linux/blob/master/arch/arm64/include/uapi/asm/hwcap.h
LLVM features: llvm-project/llvm/lib/Target/AArch64/AArch64.td
Diffstat (limited to 'library/stdarch/crates/std_detect/tests/cpu-detection.rs')
-rw-r--r--library/stdarch/crates/std_detect/tests/cpu-detection.rs22
1 files changed, 22 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 b43449c7f6f..cecc53afa4b 100644
--- a/library/stdarch/crates/std_detect/tests/cpu-detection.rs
+++ b/library/stdarch/crates/std_detect/tests/cpu-detection.rs
@@ -121,6 +121,28 @@ fn aarch64_linux() {
     println!("fp8dot4: {}", is_aarch64_feature_detected!("fp8dot4"));
     println!("fp8dot2: {}", is_aarch64_feature_detected!("fp8dot2"));
     println!("wfxt: {}", is_aarch64_feature_detected!("wfxt"));
+    println!("sme: {}", is_aarch64_feature_detected!("sme"));
+    println!("sme-i16i64: {}", is_aarch64_feature_detected!("sme-i16i64"));
+    println!("sme-f64f64: {}", is_aarch64_feature_detected!("sme-f64f64"));
+    println!("sme-fa64: {}", is_aarch64_feature_detected!("sme-fa64"));
+    println!("sme2: {}", is_aarch64_feature_detected!("sme2"));
+    println!("sme2p1: {}", is_aarch64_feature_detected!("sme2p1"));
+    println!("sme-f16f16: {}", is_aarch64_feature_detected!("sme-f16f16"));
+    println!("sme-lutv2: {}", is_aarch64_feature_detected!("sme-lutv2"));
+    println!("sme-f8f16: {}", is_aarch64_feature_detected!("sme-f8f16"));
+    println!("sme-f8f32: {}", is_aarch64_feature_detected!("sme-f8f32"));
+    println!(
+        "ssve-fp8fma: {}",
+        is_aarch64_feature_detected!("ssve-fp8fma")
+    );
+    println!(
+        "ssve-fp8dot4: {}",
+        is_aarch64_feature_detected!("ssve-fp8dot4")
+    );
+    println!(
+        "ssve-fp8dot2: {}",
+        is_aarch64_feature_detected!("ssve-fp8dot2")
+    );
 }
 
 #[test]