summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/logf.cpp
diff options
context:
space:
mode:
authorTue Ly <lntue@google.com>2022-04-07 16:02:10 -0400
committerTue Ly <lntue@google.com>2022-04-08 14:12:24 -0400
commitc5f8a0a1e929ea41bd3e0d781c6b394a3f619427 (patch)
tree9edde00f445c547d31f78d29be562c11d9834cc7 /libc/src/math/generic/logf.cpp
parentd49c0ba5abdeb8f6ebe081d96e0fdf44de46e7f8 (diff)
[libc] Add support for x86-64 targets that do not have FMA instructions.
Make FMA flag checks more accurate for x86-64 targets, and refactor polyeval to use multiply and add instead when FMA instructions are not available. Reviewed By: michaelrj, sivachandra Differential Revision: https://reviews.llvm.org/D123335
Diffstat (limited to 'libc/src/math/generic/logf.cpp')
-rw-r--r--libc/src/math/generic/logf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/src/math/generic/logf.cpp b/libc/src/math/generic/logf.cpp
index 3e712378b64c..747f8c73c27c 100644
--- a/libc/src/math/generic/logf.cpp
+++ b/libc/src/math/generic/logf.cpp
@@ -120,7 +120,7 @@ LLVM_LIBC_FUNCTION(float, logf, (float x)) {
d *= ONE_OVER_F[f_index];
double extra_factor =
- fputil::fma(static_cast<double>(m), LOG_2, LOG_F[f_index]);
+ fputil::multiply_add(static_cast<double>(m), LOG_2, LOG_F[f_index]);
double r = __llvm_libc::fputil::polyeval(
d, extra_factor, 0x1.fffffffffffacp-1, -0x1.fffffffef9cb2p-2,