summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/cfg_if/detect/os/freebsd/aarch64.rs
blob: 910d2f33b390469372271dd00acf449aff2a8c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! Run-time feature detection for Aarch64 on FreeBSD.

use crate::detect::{Feature, cache};
use super::super::aarch64::detect_features;

/// Performs run-time feature detection.
#[inline]
pub fn check_for(x: Feature) -> bool {
    cache::test(x as u32, detect_features)
}

#[cfg(test)]
mod tests {
    #[test]
    fn dump() {
        println!("asimd: {:?}", is_aarch64_feature_detected!("asimd"));
        println!("pmull: {:?}", is_aarch64_feature_detected!("pmull"));
        println!("fp: {:?}", is_aarch64_feature_detected!("fp"));
        println!("fp16: {:?}", is_aarch64_feature_detected!("fp16"));
        println!("sve: {:?}", is_aarch64_feature_detected!("sve"));
        println!("crc: {:?}", is_aarch64_feature_detected!("crc"));
        println!("crypto: {:?}", is_aarch64_feature_detected!("crypto"));
        println!("lse: {:?}", is_aarch64_feature_detected!("lse"));
        println!("rdm: {:?}", is_aarch64_feature_detected!("rdm"));
        println!("rcpc: {:?}", is_aarch64_feature_detected!("rcpc"));
        println!("dotprod: {:?}", is_aarch64_feature_detected!("dotprod"));
    }
}