Skip to content

Commit 23ed48f

Browse files
committed
Add AVX512F flag
1 parent 772ce73 commit 23ed48f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

cranelift/codegen/meta/src/isa/x86/settings.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ pub(crate) fn define(shared: &SettingGroup) -> SettingGroup {
2323
);
2424
let has_avx512vl = settings.add_bool(
2525
"has_avx512vl",
26-
"AVX512DQ: CPUID.07H:EBX.AVX512VL[bit 31]",
26+
"AVX512VL: CPUID.07H:EBX.AVX512VL[bit 31]",
27+
false,
28+
);
29+
let has_avx512f = settings.add_bool(
30+
"has_avx512f",
31+
"AVX512F: CPUID.07H:EBX.AVX512F[bit 16]",
2732
false,
2833
);
2934
let has_popcnt = settings.add_bool("has_popcnt", "POPCNT: CPUID.01H:ECX.POPCNT[bit 23]", false);
@@ -76,6 +81,10 @@ pub(crate) fn define(shared: &SettingGroup) -> SettingGroup {
7681
"use_avx512vl_simd",
7782
predicate!(shared_enable_simd && has_avx512vl),
7883
);
84+
settings.add_predicate(
85+
"use_avx512f_simd",
86+
predicate!(shared_enable_simd && has_avx512f),
87+
);
7988

8089
settings.add_predicate("use_popcnt", predicate!(has_popcnt && has_sse42));
8190
settings.add_predicate("use_bmi1", predicate!(has_bmi1));

cranelift/native/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ fn parse_x86_cpuid(isa_builder: &mut isa::Builder) -> Result<(), &'static str> {
9191
if info.has_avx512vl() {
9292
isa_builder.enable("has_avx512vl").unwrap();
9393
}
94+
if info.has_avx512f() {
95+
isa_builder.enable("has_avx512f").unwrap();
96+
}
9497
}
9598
if let Some(info) = cpuid.get_extended_function_info() {
9699
if info.has_lzcnt() {

0 commit comments

Comments
 (0)