[libc-commits] [PATCH] D123615: [libc] Automatically add -mfma flag for architectures supporting FMA.
Guillaume Chatelet via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Jun 2 13:30:42 PDT 2022
gchatelet accepted this revision.
gchatelet added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libc/cmake/modules/LLVMLibCFlagRules.cmake:135
+
+# Skip FMA_OPT flag for non-(haswell or newer) targets.
+if(NOT(LIBC_TARGET_ARCHITECTURE_IS_X86 AND (LIBC_CPU_FEATURES MATCHES "FMA")))
----------------
"Skip FMA_OPT flag for target that don't support fma"
================
Comment at: libc/test/src/math/CMakeLists.txt:1204-1205
libc.src.__support.FPUtil.fputil
+ FLAGS
+ FMA_OPT__ONLY
)
----------------
lntue wrote:
> gchatelet wrote:
> > I'm not sure I understand the semantic here. Does that mean that the test requires FMA?
> > If so does it? It would make sense to test it with and without FMA.
> >
> > Maybe I missed something.
> Yes, for this patch, this test does require FMA. That is because without FMA instructions, the current expm1f implementation is not correctly rounded for all float inputs (1 extra exceptional value). This will be fixed in the followup patch: https://reviews.llvm.org/D123440
Do you mind adding a comment ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123615/new/
https://reviews.llvm.org/D123615
More information about the libc-commits
mailing list