From dea2cf7e2228c7f5ce52fa8236c3d15fdb82b89f Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Sun, 3 Dec 2023 13:34:02 -0800 Subject: [PATCH] complete_x86_target() should enable F16C and FMA when AVX2 is present (#7971) All known AVX2-enabled architectures definitely have these features. --- src/CodeGen_X86.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CodeGen_X86.cpp b/src/CodeGen_X86.cpp index e34dd30870b4..ab099eef123c 100644 --- a/src/CodeGen_X86.cpp +++ b/src/CodeGen_X86.cpp @@ -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);