]> git.proxmox.com Git - rustc.git/blame - src/tools/rustfmt/tests/target/cfg_if/detect/os/freebsd/aarch64.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / rustfmt / tests / target / cfg_if / detect / os / freebsd / aarch64.rs
CommitLineData
f20569fa
XL
1//! Run-time feature detection for Aarch64 on FreeBSD.
2
3use super::super::aarch64::detect_features;
4use crate::detect::{cache, Feature};
5
6/// Performs run-time feature detection.
7#[inline]
8pub fn check_for(x: Feature) -> bool {
9 cache::test(x as u32, detect_features)
10}
11
12#[cfg(test)]
13mod tests {
14 #[test]
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}