diff options
Diffstat (limited to 'library/std_detect/tests')
| -rw-r--r-- | library/std_detect/tests/cpu-detection.rs | 50 | ||||
| -rw-r--r-- | library/std_detect/tests/x86-specific.rs | 42 |
2 files changed, 18 insertions, 74 deletions
diff --git a/library/std_detect/tests/cpu-detection.rs b/library/std_detect/tests/cpu-detection.rs index 7976aedc758..09a73572c1f 100644 --- a/library/std_detect/tests/cpu-detection.rs +++ b/library/std_detect/tests/cpu-detection.rs @@ -59,10 +59,7 @@ fn arm_linux() { } #[test] -#[cfg(all( - target_arch = "aarch64", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")))] fn aarch64_linux() { println!("asimd: {}", is_aarch64_feature_detected!("asimd")); println!("neon: {}", is_aarch64_feature_detected!("neon")); @@ -97,10 +94,7 @@ fn aarch64_linux() { println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes")); println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4")); println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3")); - println!( - "sve2-bitperm: {}", - is_aarch64_feature_detected!("sve2-bitperm") - ); + println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm")); println!("frintts: {}", is_aarch64_feature_detected!("frintts")); println!("i8mm: {}", is_aarch64_feature_detected!("i8mm")); println!("f32mm: {}", is_aarch64_feature_detected!("f32mm")); @@ -138,25 +132,13 @@ fn aarch64_linux() { 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") - ); + 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] -#[cfg(all( - any(target_arch = "aarch64", target_arch = "arm64ec"), - target_os = "windows" -))] +#[cfg(all(any(target_arch = "aarch64", target_arch = "arm64ec"), target_os = "windows"))] fn aarch64_windows() { println!("asimd: {:?}", is_aarch64_feature_detected!("asimd")); println!("fp: {:?}", is_aarch64_feature_detected!("fp")); @@ -171,10 +153,7 @@ fn aarch64_windows() { } #[test] -#[cfg(all( - target_arch = "aarch64", - any(target_os = "freebsd", target_os = "openbsd") -))] +#[cfg(all(target_arch = "aarch64", any(target_os = "freebsd", target_os = "openbsd")))] fn aarch64_bsd() { println!("asimd: {:?}", is_aarch64_feature_detected!("asimd")); println!("pmull: {:?}", is_aarch64_feature_detected!("pmull")); @@ -236,14 +215,8 @@ fn riscv_linux() { println!("rv32e: {}", is_riscv_feature_detected!("rv32e")); println!("rv64i: {}", is_riscv_feature_detected!("rv64i")); println!("rv128i: {}", is_riscv_feature_detected!("rv128i")); - println!( - "unaligned-scalar-mem: {}", - is_riscv_feature_detected!("unaligned-scalar-mem") - ); - println!( - "unaligned-vector-mem: {}", - is_riscv_feature_detected!("unaligned-vector-mem") - ); + println!("unaligned-scalar-mem: {}", is_riscv_feature_detected!("unaligned-scalar-mem")); + println!("unaligned-vector-mem: {}", is_riscv_feature_detected!("unaligned-vector-mem")); println!("zicsr: {}", is_riscv_feature_detected!("zicsr")); println!("zicntr: {}", is_riscv_feature_detected!("zicntr")); println!("zihpm: {}", is_riscv_feature_detected!("zihpm")); @@ -336,10 +309,7 @@ fn powerpc_linux() { } #[test] -#[cfg(all( - target_arch = "powerpc64", - any(target_os = "linux", target_os = "freebsd"), -))] +#[cfg(all(target_arch = "powerpc64", any(target_os = "linux", target_os = "freebsd"),))] fn powerpc64_linux_or_freebsd() { println!("altivec: {}", is_powerpc64_feature_detected!("altivec")); println!("vsx: {}", is_powerpc64_feature_detected!("vsx")); diff --git a/library/std_detect/tests/x86-specific.rs b/library/std_detect/tests/x86-specific.rs index d9ec79821ba..2ed2bb2a99e 100644 --- a/library/std_detect/tests/x86-specific.rs +++ b/library/std_detect/tests/x86-specific.rs @@ -1,11 +1,6 @@ #![cfg(any(target_arch = "x86", target_arch = "x86_64"))] #![allow(internal_features)] -#![feature( - stdarch_internal, - x86_amx_intrinsics, - xop_target_feature, - movrs_target_feature -)] +#![feature(stdarch_internal, x86_amx_intrinsics, xop_target_feature, movrs_target_feature)] #[macro_use] extern crate std_detect; @@ -40,24 +35,15 @@ fn dump() { println!("avx512vl: {:?}", is_x86_feature_detected!("avx512vl")); println!("avx512_ifma: {:?}", is_x86_feature_detected!("avx512ifma")); println!("avx512vbmi {:?}", is_x86_feature_detected!("avx512vbmi")); - println!( - "avx512_vpopcntdq: {:?}", - is_x86_feature_detected!("avx512vpopcntdq") - ); + println!("avx512_vpopcntdq: {:?}", is_x86_feature_detected!("avx512vpopcntdq")); println!("avx512vbmi2: {:?}", is_x86_feature_detected!("avx512vbmi2")); println!("gfni: {:?}", is_x86_feature_detected!("gfni")); println!("vaes: {:?}", is_x86_feature_detected!("vaes")); println!("vpclmulqdq: {:?}", is_x86_feature_detected!("vpclmulqdq")); println!("avx512vnni: {:?}", is_x86_feature_detected!("avx512vnni")); - println!( - "avx512bitalg: {:?}", - is_x86_feature_detected!("avx512bitalg") - ); + println!("avx512bitalg: {:?}", is_x86_feature_detected!("avx512bitalg")); println!("avx512bf16: {:?}", is_x86_feature_detected!("avx512bf16")); - println!( - "avx512vp2intersect: {:?}", - is_x86_feature_detected!("avx512vp2intersect") - ); + println!("avx512vp2intersect: {:?}", is_x86_feature_detected!("avx512vp2intersect")); println!("avx512fp16: {:?}", is_x86_feature_detected!("avx512fp16")); println!("fma: {:?}", is_x86_feature_detected!("fma")); println!("abm: {:?}", is_x86_feature_detected!("abm")); @@ -77,15 +63,9 @@ fn dump() { println!("movbe: {:?}", is_x86_feature_detected!("movbe")); println!("avxvnni: {:?}", is_x86_feature_detected!("avxvnni")); println!("avxvnniint8: {:?}", is_x86_feature_detected!("avxvnniint8")); - println!( - "avxneconvert: {:?}", - is_x86_feature_detected!("avxneconvert") - ); + println!("avxneconvert: {:?}", is_x86_feature_detected!("avxneconvert")); println!("avxifma: {:?}", is_x86_feature_detected!("avxifma")); - println!( - "avxvnniint16: {:?}", - is_x86_feature_detected!("avxvnniint16") - ); + println!("avxvnniint16: {:?}", is_x86_feature_detected!("avxvnniint16")); println!("amx-bf16: {:?}", is_x86_feature_detected!("amx-bf16")); println!("amx-tile: {:?}", is_x86_feature_detected!("amx-tile")); println!("amx-int8: {:?}", is_x86_feature_detected!("amx-int8")); @@ -96,10 +76,7 @@ fn dump() { println!("widekl: {:?}", is_x86_feature_detected!("widekl")); println!("movrs: {:?}", is_x86_feature_detected!("movrs")); println!("amx-fp8: {:?}", is_x86_feature_detected!("amx-fp8")); - println!( - "amx-transpose: {:?}", - is_x86_feature_detected!("amx-transpose") - ); + println!("amx-transpose: {:?}", is_x86_feature_detected!("amx-transpose")); println!("amx-tf32: {:?}", is_x86_feature_detected!("amx-tf32")); println!("amx-avx512: {:?}", is_x86_feature_detected!("amx-avx512")); println!("amx-movrs: {:?}", is_x86_feature_detected!("amx-movrs")); @@ -110,8 +87,5 @@ fn dump() { fn x86_deprecated() { println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni")); println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes")); - println!( - "avx512vpclmulqdq {:?}", - is_x86_feature_detected!("avx512vpclmulqdq") - ); + println!("avx512vpclmulqdq {:?}", is_x86_feature_detected!("avx512vpclmulqdq")); } |
