Check for AVX512 at runtime to avoid invalid opcode trap (#8166)

automerge
This commit is contained in:
Michael Vines
2020-02-07 16:01:45 -07:00
committed by GitHub
parent 99432833d2
commit ef5fb6fa46
2 changed files with 18 additions and 0 deletions

8
core/build.rs Normal file
View File

@ -0,0 +1,8 @@
fn main() {
// Until https://github.com/rust-lang/rust/issues/44839 is resolved
// `#[target_feature(enable = "avx512f")]` is not available.
// Use an env flag instead:
if is_x86_feature_detected!("avx512f") {
println!("cargo:rustc-env=TARGET_FEATURE_AVX512F=1");
}
}