Skip to content

Commit

Permalink
Change feature detection names
Browse files Browse the repository at this point in the history
  • Loading branch information
calebzulawski committed Nov 16, 2022
1 parent 8f3ebb8 commit 0fdfaf0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
3 changes: 3 additions & 0 deletions crates/core_arch/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ fn x86_all() {
is_x86_feature_detected!("avx512vpopcntdq")
);
println!("avx512vbmi2 {:?}", is_x86_feature_detected!("avx512vbmi2"));
println!("gfni {:?}", is_x86_feature_detected!("gfni"));
println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni"));
println!("vaes {:?}", is_x86_feature_detected!("vaes"));
println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes"));
println!("vpclmulqdq {:?}", is_x86_feature_detected!("vpclmulqdq"));
println!(
"avx512vpclmulqdq {:?}",
is_x86_feature_detected!("avx512vpclmulqdq")
Expand Down
15 changes: 9 additions & 6 deletions crates/std_detect/src/detect/arch/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ features! {
/// * `"avx512vbmi"`
/// * `"avx512vpopcntdq"`
/// * `"avx512vbmi2"`
/// * `"avx512gfni"`
/// * `"avx512vaes"`
/// * `"avx512vpclmulqdq"`
/// * `"gfni"`
/// * `"vaes"`
/// * `"vpclmulqdq"`
/// * `"avx512vnni"`
/// * `"avx512bitalg"`
/// * `"avx512bf16"`
Expand All @@ -95,6 +95,9 @@ features! {
/// [docs]: https://software.intel.com/sites/landingpage/IntrinsicsGuide
#[stable(feature = "simd_x86", since = "1.27.0")]
@BIND_FEATURE_NAME: "abm"; "lzcnt"; // abm is a synonym for lzcnt
@BIND_FEATURE_NAME: "avx512gfni"; "gfni"; // avx512gfni was previously used for gnfi
@BIND_FEATURE_NAME: "avx512vaes"; "vaes"; // avx512vaes was previously used for vaes
@BIND_FEATURE_NAME: "avx512vpclmulqdq"; "vpclmulqdq"; // avx512vpclmulqdq was previously used for vpclmulqdq
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] aes: "aes";
/// AES (Advanced Encryption Standard New Instructions AES-NI)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] pclmulqdq: "pclmulqdq";
Expand Down Expand Up @@ -150,11 +153,11 @@ features! {
/// Quadword)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512vbmi2: "avx512vbmi2";
/// AVX-512 VBMI2 (Additional byte, word, dword and qword capabilities)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512gfni: "avx512gfni";
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] gfni: "gfni";
/// AVX-512 GFNI (Galois Field New Instruction)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512vaes: "avx512vaes";
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] vaes: "vaes";
/// AVX-512 VAES (Vector AES instruction)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512vpclmulqdq: "avx512vpclmulqdq";
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] vpclmulqdq: "vpclmulqdq";
/// AVX-512 VPCLMULQDQ (Vector PCLMULQDQ instructions)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512vnni: "avx512vnni";
/// AVX-512 VNNI (Vector Neural Network Instructions)
Expand Down
6 changes: 3 additions & 3 deletions crates/std_detect/src/detect/os/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ pub(crate) fn detect_features() -> cache::Initializer {
enable(extended_features_ecx, 1, Feature::avx512vbmi);
enable(extended_features_ecx, 5, Feature::avx512bf16);
enable(extended_features_ecx, 6, Feature::avx512vbmi2);
enable(extended_features_ecx, 8, Feature::avx512gfni);
enable(extended_features_ecx, 8, Feature::gfni);
enable(extended_features_ecx, 8, Feature::avx512vp2intersect);
enable(extended_features_ecx, 9, Feature::avx512vaes);
enable(extended_features_ecx, 10, Feature::avx512vpclmulqdq);
enable(extended_features_ecx, 9, Feature::vaes);
enable(extended_features_ecx, 10, Feature::vpclmulqdq);
enable(extended_features_ecx, 11, Feature::avx512vnni);
enable(extended_features_ecx, 12, Feature::avx512bitalg);
enable(extended_features_ecx, 14, Feature::avx512vpopcntdq);
Expand Down
3 changes: 3 additions & 0 deletions crates/std_detect/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ fn x86_all() {
is_x86_feature_detected!("avx512vpopcntdq")
);
println!("avx512vbmi2 {:?}", is_x86_feature_detected!("avx512vbmi2"));
println!("gfni {:?}", is_x86_feature_detected!("gfni"));
println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni"));
println!("vaes {:?}", is_x86_feature_detected!("vaes"));
println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes"));
println!("vpclmulqdq {:?}", is_x86_feature_detected!("vpclmulqdq"));
println!(
"avx512vpclmulqdq {:?}",
is_x86_feature_detected!("avx512vpclmulqdq")
Expand Down
3 changes: 3 additions & 0 deletions crates/std_detect/tests/x86-specific.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ fn dump() {
is_x86_feature_detected!("avx512vpopcntdq")
);
println!("avx512vbmi2 {:?}", is_x86_feature_detected!("avx512vbmi2"));
println!("gfni {:?}", is_x86_feature_detected!("gfni"));
println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni"));
println!("vaes {:?}", is_x86_feature_detected!("vaes"));
println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes"));
println!("vpclmulqdq {:?}", is_x86_feature_detected!("vpclmulqdq"));
println!(
"avx512vpclmulqdq {:?}",
is_x86_feature_detected!("avx512vpclmulqdq")
Expand Down

0 comments on commit 0fdfaf0

Please sign in to comment.