From 2c416484710ae64b7237597dbf6a321b5ca4662c Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 14 Feb 2020 13:24:13 -0800 Subject: [PATCH] Wire up AVX-related settings with runtime detection in cranelift-native --- cranelift/native/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cranelift/native/src/lib.rs b/cranelift/native/src/lib.rs index 9ad873e166..b45dab8dd5 100644 --- a/cranelift/native/src/lib.rs +++ b/cranelift/native/src/lib.rs @@ -82,6 +82,15 @@ fn parse_x86_cpuid(isa_builder: &mut isa::Builder) -> Result<(), &'static str> { if info.has_bmi2() { isa_builder.enable("has_bmi2").unwrap(); } + if info.has_avx2() { + isa_builder.enable("has_avx2").unwrap(); + } + if info.has_avx512dq() { + isa_builder.enable("has_avx512dq").unwrap(); + } + if info.has_avx512vl() { + isa_builder.enable("has_avx512vl").unwrap(); + } } if let Some(info) = cpuid.get_extended_function_info() { if info.has_lzcnt() {