1 //! Run-time feature detection for Aarch64 on FreeBSD.
2 
3 use super::super::aarch64::detect_features;
4 use crate::detect::{cache, Feature};
5 
6 /// Performs run-time feature detection.
7 #[inline]
check_for(x: Feature) -> bool8 pub fn check_for(x: Feature) -> bool {
9     cache::test(x as u32, detect_features)
10 }
11 
12 #[cfg(test)]
13 mod tests {
14     #[test]
dump()15     fn dump() {
16         println!("asimd: {:?}", is_aarch64_feature_detected!("asimd"));
17         println!("pmull: {:?}", is_aarch64_feature_detected!("pmull"));
18         println!("fp: {:?}", is_aarch64_feature_detected!("fp"));
19         println!("fp16: {:?}", is_aarch64_feature_detected!("fp16"));
20         println!("sve: {:?}", is_aarch64_feature_detected!("sve"));
21         println!("crc: {:?}", is_aarch64_feature_detected!("crc"));
22         println!("crypto: {:?}", is_aarch64_feature_detected!("crypto"));
23         println!("lse: {:?}", is_aarch64_feature_detected!("lse"));
24         println!("rdm: {:?}", is_aarch64_feature_detected!("rdm"));
25         println!("rcpc: {:?}", is_aarch64_feature_detected!("rcpc"));
26         println!("dotprod: {:?}", is_aarch64_feature_detected!("dotprod"));
27     }
28 }
29