Skip to content

Commit

Permalink
complete_x86_target() should enable F16C and FMA when AVX2 is present (
Browse files Browse the repository at this point in the history
…#7971)

All known AVX2-enabled architectures definitely have these features.
  • Loading branch information
steven-johnson authored Dec 3, 2023
1 parent 674e6cc commit dea2cf7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CodeGen_X86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Target complete_x86_target(Target t) {
}
if (t.has_feature(Target::AVX2)) {
t.set_feature(Target::AVX);
// All AVX2-enabled architectures have F16C and FMA
t.set_feature(Target::F16C);
t.set_feature(Target::FMA);
}
if (t.has_feature(Target::AVX)) {
t.set_feature(Target::SSE41);
Expand Down

0 comments on commit dea2cf7

Please sign in to comment.