[libc] Automatically add -mfma flag for architectures supporting FMA.
authorTue Ly <lntue.h@gmail.com>
Sun, 8 May 2022 17:47:08 +0000 (13:47 -0400)
committerTue Ly <lntue@google.com>
Fri, 3 Jun 2022 05:21:20 +0000 (01:21 -0400)
commit614567a7bf4a7a4c2570ad9a499b77155dfb54ce
treed166f692528f18a441e583835588aa81f42f16b9
parent78b16ccf2b5c4ba4ebd7f1e2a2fc1dcad0e1a343
[libc] Automatically add -mfma flag for architectures supporting FMA.

Detect if the architecture supports FMA instructions and if
the targets depend on fma.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D123615
20 files changed:
libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
libc/cmake/modules/LLVMLibCFlagRules.cmake
libc/cmake/modules/LLVMLibCObjectRules.cmake
libc/src/__support/FPUtil/CMakeLists.txt
libc/src/__support/FPUtil/PolyEval.h
libc/src/__support/FPUtil/x86_64/FMA.h
libc/src/__support/FPUtil/x86_64/PolyEval.h
libc/src/__support/architectures.h
libc/src/math/CMakeLists.txt
libc/src/math/fma.cpp
libc/src/math/fmaf.cpp
libc/src/math/generic/CMakeLists.txt
libc/src/math/generic/exp2f.cpp
libc/src/math/generic/expf.cpp
libc/src/math/generic/expm1f.cpp
libc/src/math/generic/log10f.cpp
libc/src/math/generic/log1pf.cpp
libc/src/math/generic/log2f.cpp
libc/src/math/generic/logf.cpp
libc/test/src/math/CMakeLists.txt