Skip to content

Add Icelake avx512 features #838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,12 @@ jobs:
run: |
curl https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
echo "##[add-path]$HOME/.cargo/bin"
rustup update nightly --no-self-update
rustup default nightly
if: matrix.os == 'macos-latest'
- run: rustup target add ${{ matrix.target }}
- run: |
rustup default nightly
rustup target add ${{ matrix.target }}
if: "!endsWith(matrix.target, 'emulated')"
- run: cargo generate-lockfile

Expand Down
17 changes: 17 additions & 0 deletions crates/core_arch/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ fn x86_all() {
"avx512_vpopcntdq {:?}",
is_x86_feature_detected!("avx512vpopcntdq")
);
println!("avx512vbmi2 {:?}", is_x86_feature_detected!("avx512vbmi2"));
println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni"));
println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes"));
println!(
"avx512vpclmulqdq {:?}",
is_x86_feature_detected!("avx512vpclmulqdq")
);
println!("avx512vnni {:?}", is_x86_feature_detected!("avx512vnni"));
println!(
"avx512bitalg {:?}",
is_x86_feature_detected!("avx512bitalg")
);
println!("avx512bf16 {:?}", is_x86_feature_detected!("avx512bf16"));
println!(
"avx512vp2intersect {:?}",
is_x86_feature_detected!("avx512vp2intersect")
);
println!("f16c: {:?}", is_x86_feature_detected!("f16c"));
println!("fma: {:?}", is_x86_feature_detected!("fma"));
println!("abm: {:?}", is_x86_feature_detected!("abm"));
Expand Down
16 changes: 16 additions & 0 deletions crates/std_detect/src/detect/arch/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ features! {
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vpopcntdq: "avx512vpopcntdq";
/// AVX-512 VPOPCNTDQ (Vector Population Count Doubleword and
/// Quadword)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vbmi2: "avx512vbmi2";
/// AVX-512 VBMI2 (Additional byte, word, dword and qword capabilities)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512gfni: "avx512gfni";
/// AVX-512 GFNI (Galois Field New Instruction)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vaes: "avx512vaes";
/// AVX-512 VAES (Vector AES instruction)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vpclmulqdq: "avx512vpclmulqdq";
/// AVX-512 VPCLMULQDQ (Vector PCLMULQDQ instructions)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vnni: "avx512vnni";
/// AVX-512 VNNI (Vector Neural Network Instructions)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512bitalg: "avx512bitalg";
/// AVX-512 BITALG (Support for VPOPCNT[B,W] and VPSHUFBITQMB)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512bf16: "avx512bf16";
/// AVX-512 BF16 (BFLOAT16 instructions)
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vp2intersect: "avx512vp2intersect";
/// AVX-512 P2INTERSECT
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] f16c: "f16c";
/// F16C (Conversions between IEEE-754 `binary16` and `binary32` formats)
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] fma: "fma";
Expand Down
8 changes: 8 additions & 0 deletions crates/std_detect/src/detect/os/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ pub(crate) fn detect_features() -> cache::Initializer {
enable(extended_features_ebx, 30, Feature::avx512bw);
enable(extended_features_ebx, 31, Feature::avx512vl);
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::avx512vp2intersect);
enable(extended_features_ecx, 9, Feature::avx512vaes);
enable(extended_features_ecx, 10, Feature::avx512vpclmulqdq);
enable(extended_features_ecx, 11, Feature::avx512vnni);
enable(extended_features_ecx, 12, Feature::avx512bitalg);
enable(extended_features_ecx, 14, Feature::avx512vpopcntdq);
}
}
Expand Down
17 changes: 17 additions & 0 deletions crates/std_detect/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ fn x86_all() {
"avx512vpopcntdq: {:?}",
is_x86_feature_detected!("avx512vpopcntdq")
);
println!("avx512vbmi2 {:?}", is_x86_feature_detected!("avx512vbmi2"));
println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni"));
println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes"));
println!(
"avx512vpclmulqdq {:?}",
is_x86_feature_detected!("avx512vpclmulqdq")
);
println!("avx512vnni {:?}", is_x86_feature_detected!("avx512vnni"));
println!(
"avx512bitalg {:?}",
is_x86_feature_detected!("avx512bitalg")
);
println!("avx512bf16 {:?}", is_x86_feature_detected!("avx512bf16"));
println!(
"avx512vp2intersect {:?}",
is_x86_feature_detected!("avx512vp2intersect")
);
println!("f16c: {:?}", is_x86_feature_detected!("f16c"));
println!("fma: {:?}", is_x86_feature_detected!("fma"));
println!("bmi1: {:?}", is_x86_feature_detected!("bmi1"));
Expand Down
17 changes: 17 additions & 0 deletions crates/std_detect/tests/x86-specific.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ fn dump() {
"avx512_vpopcntdq {:?}",
is_x86_feature_detected!("avx512vpopcntdq")
);
println!("avx512vbmi2 {:?}", is_x86_feature_detected!("avx512vbmi2"));
println!("avx512gfni {:?}", is_x86_feature_detected!("avx512gfni"));
println!("avx512vaes {:?}", is_x86_feature_detected!("avx512vaes"));
println!(
"avx512vpclmulqdq {:?}",
is_x86_feature_detected!("avx512vpclmulqdq")
);
println!("avx512vnni {:?}", is_x86_feature_detected!("avx512vnni"));
println!(
"avx512bitalg {:?}",
is_x86_feature_detected!("avx512bitalg")
);
println!("avx512bf16 {:?}", is_x86_feature_detected!("avx512bf16"));
println!(
"avx512vp2intersect {:?}",
is_x86_feature_detected!("avx512vp2intersect")
);
println!("fma: {:?}", is_x86_feature_detected!("fma"));
println!("abm: {:?}", is_x86_feature_detected!("abm"));
println!("bmi: {:?}", is_x86_feature_detected!("bmi1"));
Expand Down