[libc-commits] [libc] [libc][math] Integer-only implementation of expf with 1-ULP errors (PR #209406)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Tue Jul 28 03:20:39 PDT 2026


=?utf-8?q?Hoàng_Minh_Thiên?=,=?utf-8?q?Hoàng_Minh_Thiên?=,
=?utf-8?q?Hoàng_Minh_Thiên?=,=?utf-8?q?Hoàng_Minh_Thiên?=,
=?utf-8?q?Hoàng_Minh_Thiên?=,=?utf-8?q?Hoàng_Minh_Thiên?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/209406 at github.com>


================
@@ -8,9 +8,18 @@
 
 #include "src/math/expf.h"
 #include "src/__support/math/expf.h"
+#include "src/__support/math/expf_integer_eval.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
-LLVM_LIBC_FUNCTION(float, expf, (float x)) { return math::expf(x); }
+LLVM_LIBC_FUNCTION(float, expf, (float x)) {
+#if defined(LIBC_MATH_HAS_SKIP_ACCURATE_PASS) &&                               \
+    defined(LIBC_MATH_SMALL_TABLES) &&                                         \
+    !defined(LIBC_TARGET_CPU_HAS_FPU_DOUBLE)
+  return math::integer_only::expf(x);
----------------
vhscampos wrote:

This whole change needs associated tests.

https://github.com/llvm/llvm-project/pull/209406


More information about the libc-commits mailing list