Skip to content

Commit

Permalink
[libc] Update FMA detection macro for x86-64 targets.
Browse files Browse the repository at this point in the history
To generate fma instructions for x86-64 targets, we need both -mavx2
and -mfma.

Reviewed By: brooksmoses

Differential Revision: https://reviews.llvm.org/D152410
  • Loading branch information
lntue committed Jun 7, 2023
1 parent d338727 commit 4ade88a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/src/__support/macros/properties/cpu_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define LIBC_TARGET_CPU_HAS_AVX512BW
#endif

#if defined(__ARM_FEATURE_FMA) || defined(__AVX2__) || defined(__FMA__) || \
#if defined(__ARM_FEATURE_FMA) || (defined(__AVX2__) && defined(__FMA__)) || \
defined(__LIBC_RISCV_USE_FMA)
#define LIBC_TARGET_CPU_HAS_FMA
#endif
Expand Down

0 comments on commit 4ade88a

Please sign in to comment.