about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect/tests/cpu-detection.rs
diff options
context:
space:
mode:
authorsayantn <sayantan.chakraborty@students.iiserpune.ac.in>2024-06-20 00:34:46 +0530
committerAmanieu d'Antras <amanieu@gmail.com>2024-07-06 11:29:28 +0200
commit268ac7fe921a6cf92c8393cb23fe3bd4d2ffbf13 (patch)
tree36e92010f65459b8ce35e0fac84d3181dd8ec543 /library/stdarch/crates/std_detect/tests/cpu-detection.rs
parentc862e4e4877820ff517474a7be47e5546d4f8319 (diff)
downloadrust-268ac7fe921a6cf92c8393cb23fe3bd4d2ffbf13.tar.gz
rust-268ac7fe921a6cf92c8393cb23fe3bd4d2ffbf13.zip
Add detection for SHA512, SM3 and SM4
Cannot cross-verify with `cupid` because they do not have these features yet.
Diffstat (limited to 'library/stdarch/crates/std_detect/tests/cpu-detection.rs')
-rw-r--r--library/stdarch/crates/std_detect/tests/cpu-detection.rs7
1 files changed, 7 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 fcad846fbd9..6cf74a67218 100644
--- a/library/stdarch/crates/std_detect/tests/cpu-detection.rs
+++ b/library/stdarch/crates/std_detect/tests/cpu-detection.rs
@@ -3,6 +3,10 @@
 #![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
 #![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))]
 #![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))]
+#![cfg_attr(
+    any(target_arch = "x86", target_arch = "x86_64"),
+    feature(sha512_sm_x86)
+)]
 #![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)]
 
 #[cfg_attr(
@@ -210,6 +214,9 @@ fn x86_all() {
     println!("sha: {:?}", is_x86_feature_detected!("sha"));
     println!("avx: {:?}", is_x86_feature_detected!("avx"));
     println!("avx2: {:?}", is_x86_feature_detected!("avx2"));
+    println!("sha512: {:?}", is_x86_feature_detected!("sha512"));
+    println!("sm3: {:?}", is_x86_feature_detected!("sm3"));
+    println!("sm4: {:?}", is_x86_feature_detected!("sm4"));
     println!("avx512f: {:?}", is_x86_feature_detected!("avx512f"));
     println!("avx512cd: {:?}", is_x86_feature_detected!("avx512cd"));
     println!("avx512er: {:?}", is_x86_feature_detected!("avx512er"));