summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/powf.cpp
diff options
context:
space:
mode:
authorOliver Hunt <oliver@apple.com>2025-10-20 01:38:07 -0700
committerGitHub <noreply@github.com>2025-10-20 01:38:07 -0700
commit7de01aa5d0418bd4e8db2917f831e7383c6863bb (patch)
tree1db866f57c2236573cd4b4c2d141d6d420f87a92 /libc/src/math/generic/powf.cpp
parent6bc540043d4c3fed8f44c8f6de86be0d1740582e (diff)
parent46a866ab7735aaa0f89fde209d516271c4825c49 (diff)
Merge branch 'main' into users/ojhunt/ptrauth-additionsusers/ojhunt/ptrauth-additions
Diffstat (limited to 'libc/src/math/generic/powf.cpp')
-rw-r--r--libc/src/math/generic/powf.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/libc/src/math/generic/powf.cpp b/libc/src/math/generic/powf.cpp
index a45ef511c9ba..dd2b6aa788b9 100644
--- a/libc/src/math/generic/powf.cpp
+++ b/libc/src/math/generic/powf.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "src/math/powf.h"
-#include "common_constants.h" // Lookup tables EXP_M1 and EXP_M2.
#include "src/__support/CPP/bit.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
@@ -15,12 +14,14 @@
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/nearest_integer.h"
#include "src/__support/FPUtil/sqrt.h" // Speedup for powf(x, 1/2) = sqrtf(x)
+#include "src/__support/FPUtil/triple_double.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
+#include "src/__support/math/common_constants.h" // Lookup tables EXP_M1 and EXP_M2.
#include "src/__support/math/exp10f.h" // Speedup for powf(10, y) = exp10f(y)
-
-#include "exp2f_impl.h" // Speedup for powf(2, y) = exp2f(y)
+#include "src/__support/math/exp2f.h" // Speedup for powf(2, y) = exp2f(y)
+#include "src/__support/math/exp_constants.h"
namespace LIBC_NAMESPACE_DECL {
@@ -29,6 +30,8 @@ using fputil::TripleDouble;
namespace {
+using namespace common_constants_internal;
+
#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
alignas(16) constexpr DoubleDouble LOG2_R_DD[128] = {
{0.0, 0.0},
@@ -775,7 +778,7 @@ LLVM_LIBC_FUNCTION(float, powf, (float x, float y)) {
#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
case 0x4000'0000: // x = 2.0f
// pow(2, y) = exp2(y)
- return generic::exp2f(y);
+ return math::exp2f(y);
case 0x4120'0000: // x = 10.0f
// pow(10, y) = exp10(y)
return math::exp10f(y);