[libc-commits] [libc] [llvm] [libc][math] Add integer-only implementation for exp10f. (PR #237009)
via libc-commits
libc-commits at lists.llvm.org
Sat Nov 14 07:26:18 PST 2026
https://github.com/lntue updated https://github.com/llvm/llvm-project/pull/237009
>From d5aba6994b82c9785deded0052e8127c00224b40 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Fri, 16 Oct 2026 20:41:25 +0000
Subject: [PATCH 1/2] [libc][math] Add integer-only implementation for exp10f.
- Add `src/__support/math/exp10f_integer_eval.h` using the shared `exp2_eval` and fixed-point utilities from `exp2f_integer_utils.h`.
- Select `exp10f_integer_eval` in `src/__support/math/exp10f.h` when `!defined(LIBC_TARGET_CPU_HAS_FPU_DOUBLE) && defined(LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY) && defined(LIBC_MATH_HAS_NO_EXCEPT) && defined(LIBC_MATH_HAS_NO_ERRNO)`.
- Expose `exp10f` with explicit rounding mode parameter under `LIBC_NAMESPACE::shared::static_rounding`.
- Add smoke, unit, exhaustive, and shared math test coverage for `exp10f_integer_eval` and `static_rounding::exp10f`.
Assisted-by: Gemini is used for code size analysis, performance tuning, and test refactoring.
---
libc/shared/math/static_rounding/exp10f.h | 30 ++++
libc/shared/static_rounding_math.h | 1 +
libc/src/__support/math/CMakeLists.txt | 16 ++
libc/src/__support/math/exp10f.h | 6 +
libc/src/__support/math/exp10f_integer_eval.h | 146 ++++++++++++++++++
libc/test/shared/shared_math_test.cpp | 31 ++++
libc/test/src/math/CMakeLists.txt | 1 +
libc/test/src/math/exhaustive/CMakeLists.txt | 3 +
libc/test/src/math/exhaustive/exp10f_test.cpp | 20 ++-
libc/test/src/math/exp10f_test.cpp | 75 ++++++---
libc/test/src/math/smoke/CMakeLists.txt | 1 +
libc/test/src/math/smoke/exp10f_test.cpp | 53 +++++--
.../llvm-project-overlay/libc/BUILD.bazel | 28 ++++
.../libc/test/src/math/BUILD.bazel | 1 +
.../libc/test/src/math/smoke/BUILD.bazel | 1 +
15 files changed, 378 insertions(+), 35 deletions(-)
create mode 100644 libc/shared/math/static_rounding/exp10f.h
create mode 100644 libc/src/__support/math/exp10f_integer_eval.h
diff --git a/libc/shared/math/static_rounding/exp10f.h b/libc/shared/math/static_rounding/exp10f.h
new file mode 100644
index 00000000000000..923e6cc67960df
--- /dev/null
+++ b/libc/shared/math/static_rounding/exp10f.h
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains the shared statically-rounded exp10f(x) function
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_STATIC_ROUNDING_EXP10F_H
+#define LLVM_LIBC_SHARED_MATH_STATIC_ROUNDING_EXP10F_H
+
+#include "shared/libc_common.h"
+#include "src/__support/math/exp10f_integer_eval.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+namespace static_rounding {
+
+using math::static_rounding::exp10f;
+
+} // namespace static_rounding
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_STATIC_ROUNDING_EXP10F_H
diff --git a/libc/shared/static_rounding_math.h b/libc/shared/static_rounding_math.h
index 9fc00ade2be962..ee3baae081401c 100644
--- a/libc/shared/static_rounding_math.h
+++ b/libc/shared/static_rounding_math.h
@@ -15,6 +15,7 @@
#define LLVM_LIBC_SHARED_STATIC_ROUNDING_MATH_H
#include "shared/libc_common.h"
+#include "shared/math/static_rounding/exp10f.h"
#include "shared/math/static_rounding/exp2f.h"
#include "shared/math/static_rounding/expf.h"
diff --git a/libc/src/__support/math/CMakeLists.txt b/libc/src/__support/math/CMakeLists.txt
index eb039efc77f544..4b8123cfca36d9 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -4747,6 +4747,21 @@ add_header_library(
libc.src.__support.macros.properties.cpu_features
)
+add_header_library(
+ exp10f_integer_eval
+ HDRS
+ exp10f_integer_eval.h
+ DEPENDS
+ .exp2f_integer_utils
+ libc.hdr.fenv_macros
+ libc.src.__support.CPP.bit
+ libc.src.__support.FPUtil.fp_bits
+ libc.src.__support.frac64
+ libc.src.__support.macros.attributes
+ libc.src.__support.macros.config
+ libc.src.__support.macros.optimization
+)
+
add_header_library(
exp10f
HDRS
@@ -4754,6 +4769,7 @@ add_header_library(
DEPENDS
.exp10f_double_eval
.exp10f_float_eval
+ .exp10f_integer_eval
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.optimization
diff --git a/libc/src/__support/math/exp10f.h b/libc/src/__support/math/exp10f.h
index 14e808e9473957..98e74b3ed233b8 100644
--- a/libc/src/__support/math/exp10f.h
+++ b/libc/src/__support/math/exp10f.h
@@ -25,6 +25,10 @@
(defined(LIBC_MATH_HAS_SMALL_TABLES) || \
defined(LIBC_MATH_HAS_INTERMEDIATE_COMP_IN_FLOAT))
#define LIBC_MATH_EXP10F_IMPL float_eval
+#elif !defined(LIBC_TARGET_CPU_HAS_FPU_DOUBLE) && \
+ defined(LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY) && \
+ defined(LIBC_MATH_HAS_NO_EXCEPT) && defined(LIBC_MATH_HAS_NO_ERRNO)
+#define LIBC_MATH_EXP10F_IMPL integer_eval
#else
#define LIBC_MATH_EXP10F_IMPL double_eval
#endif
@@ -32,6 +36,8 @@
#if LIBC_MATH_IMPL_IS(LIBC_MATH_EXP10F_IMPL, float_eval)
#include "src/__support/math/exp10f_float_eval.h"
+#elif LIBC_MATH_IMPL_IS(LIBC_MATH_EXP10F_IMPL, integer_eval)
+#include "src/__support/math/exp10f_integer_eval.h"
#elif LIBC_MATH_IMPL_IS(LIBC_MATH_EXP10F_IMPL, double_eval)
#include "src/__support/math/exp10f_double_eval.h"
#else
diff --git a/libc/src/__support/math/exp10f_integer_eval.h b/libc/src/__support/math/exp10f_integer_eval.h
new file mode 100644
index 00000000000000..5df88356639d08
--- /dev/null
+++ b/libc/src/__support/math/exp10f_integer_eval.h
@@ -0,0 +1,146 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Integer-only implementation of exp10f.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP10F_INTEGER_EVAL_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP10F_INTEGER_EVAL_H
+
+#include "hdr/fenv_macros.h"
+#include "src/__support/CPP/bit.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/frac64.h"
+#include "src/__support/macros/attributes.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/optimization.h"
+#include "src/__support/math/exp2f_integer_utils.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace math {
+namespace static_rounding {
+
+// Constants generated by Sollya with:
+// > display = hexadecimal;
+// > round(log2(10) * 2^62, 64, RN);
+// LSB(LOG2_10) = 2^-62
+LIBC_INLINE_VAR constexpr Frac64 LOG2_10 = Frac64(0xd49a'784b'cd1b'8afe);
+
+// IEEE 754 single-precision bit representations of exact powers 10^1 .. 10^10.
+LIBC_INLINE_VAR constexpr uint32_t EXP10_POWERS[10] = {
+ 0x4120'0000U, // 10^1
+ 0x42c8'0000U, // 10^2
+ 0x447a'0000U, // 10^3
+ 0x461c'4000U, // 10^4
+ 0x47c3'5000U, // 10^5
+ 0x4974'2400U, // 10^6
+ 0x4b18'9680U, // 10^7
+ 0x4cbe'bc20U, // 10^8
+ 0x4e6e'6b28U, // 10^9
+ 0x5015'02f9U, // 10^10
+};
+
+LIBC_ALWAYS_INLINE uint32_t exp10f_bits(uint32_t x_u,
+ [[maybe_unused]] int rounding) {
+ using FPBits = fputil::FPBits<float>;
+
+ bool is_neg = (x_u >> 31) != 0;
+ uint32_t x_abs = x_u & 0x7fff'ffffU;
+ uint32_t x_e = x_abs >> FPBits::FRACTION_LEN;
+
+ // When |x| < 2^-26 (x_e <= 100) or |x| >= 32 (x_e >= 132):
+ if (LIBC_UNLIKELY(x_e - 101U >= 31U)) {
+ // |x| < 2^-26
+ if (x_e <= 100U) {
+#ifndef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ if (LIBC_UNLIKELY(rounding != FE_TONEAREST)) {
+ if (rounding == FE_UPWARD && static_cast<int32_t>(x_u) > 0) // x > +0.0f
+ return 0x3f80'0001U; // 0x1.000002p+0f (1.0f + 2^-23f)
+
+ if ((rounding == FE_DOWNWARD || rounding == FE_TOWARDZERO) &&
+ x_u > 0x8000'0000U) // x < -0.0f
+ return 0x3f7f'ffffU; // 0x1.fffffep-1f (1.0f - 2^-24f)
+
+ return 0x3f80'0000U; // 1.0f
+ }
+#endif // !LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ // 10^x rounds to 1.0f (0x3f80'0000U) or 1.0f - 2^-24f (0x3f7f'ffffU) when
+ // x <= log10(1 - 2^-25) ~ -0x1.bcb7b2p-27f (0xb25e'5bd9U).
+ return 0x3f80'0000U - static_cast<uint32_t>(x_u >= 0xb25e'5bd9U);
+ }
+
+ // exp10(nan) = nan
+ if (x_abs > 0x7f80'0000U) // |x| > +inf (x is NaN)
+ return x_u | 0x0040'0000U; // quiet NaN
+
+ // x >= 0x1.344136p+5f > log10(2^128) or +inf
+ if (!is_neg && x_u >= 0x421a'209bU) {
+#ifndef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ if ((rounding == FE_DOWNWARD || rounding == FE_TOWARDZERO) &&
+ x_u < 0x7f80'0000U) // x < +inf
+ return 0x7f7f'ffffU; // 0x1.fffffep+127f (FLT_MAX)
+#endif // !LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ return 0x7f80'0000U; // +inf
+ }
+
+ // x <= -0x1.693c6cp+5f < log10(2^-150) or -inf
+ if (x_u >= 0xc234'9e36U) {
+#ifndef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ if (rounding == FE_UPWARD && x_u < 0xff80'0000U) // x > -inf
+ return 0x0000'0001U; // 0x1.0p-149f (FLT_TRUE_MIN)
+#endif // !LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ return 0x0000'0000U; // +0.0f
+ }
+ }
+
+#ifndef LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+ // Exact outputs when x = 1, 2, ..., 10 in directed rounding modes:
+ // - (x_u << 12) == 0 filters out inputs with nonzero low 20 fraction bits.
+ // - 0x3f8 is the high 12 bits of 1.0f, and 0x3f8 + 0x1a = 0x412 is 10.0f.
+ // - scaled = (8 | (d & 7)) << (d >> 3) computes 8 * x; (scaled & 7) == 0
+ // checks that the 3 fractional bits of x are zero, giving n = scaled >> 3.
+ if (rounding != FE_TONEAREST && LIBC_UNLIKELY((x_u << 12) == 0)) {
+ uint32_t d = (x_u >> 20) - 0x3f8U;
+ if (d <= 0x1aU) {
+ uint32_t scaled = (8U | (d & 7U)) << (d >> 3);
+ if ((scaled & 7U) == 0U)
+ return EXP10_POWERS[(scaled >> 3) - 1U];
+ }
+ }
+#endif // !LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY
+
+ // Range reduction:
+ // k = floor(x * log2(10))
+ // x * log2(10) = k + u, with u in [0, 1)
+ // 10^x = 2^(k + u) = 2^k * 2^u
+ uint64_t u_bits = exp_b_scale(x_u, x_e, LOG2_10, 132U);
+ return exp2f_eval_bits(u_bits, is_neg, rounding);
+}
+
+// Statically rounded, no-except implementation of exp10f using integer-only
+// arithmetic.
+LIBC_ALWAYS_INLINE float exp10f(float x, [[maybe_unused]] int rounding) {
+ return cpp::bit_cast<float>(
+ exp10f_bits(cpp::bit_cast<uint32_t>(x), rounding));
+}
+
+} // namespace static_rounding
+
+namespace integer_eval {
+
+LIBC_ALWAYS_INLINE float exp10f(float x) {
+ return static_rounding::exp10f(x, FE_TONEAREST);
+}
+
+} // namespace integer_eval
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_EXP10F_INTEGER_EVAL_H
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index 53cf9a94c39b29..023ee64d0f1abe 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -972,11 +972,17 @@ TEST(LlvmLibcSharedMathTest, StaticRounding) {
1.0f, LIBC_NAMESPACE::shared::static_rounding::expf(0.0f, FE_TONEAREST));
EXPECT_FP_EQ(
1.0f, LIBC_NAMESPACE::shared::static_rounding::exp2f(0.0f, FE_TONEAREST));
+ EXPECT_FP_EQ(1.0f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 0.0f, FE_TONEAREST));
EXPECT_FP_EQ(
2.0f, LIBC_NAMESPACE::shared::static_rounding::exp2f(1.0f, FE_TONEAREST));
EXPECT_FP_EQ(0.5f, LIBC_NAMESPACE::shared::static_rounding::exp2f(
-1.0f, FE_TONEAREST));
+ EXPECT_FP_EQ(10.0f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 1.0f, FE_TONEAREST));
+ EXPECT_FP_EQ(100.0f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 2.0f, FE_TONEAREST));
EXPECT_FP_EQ(0x1.5bf0a8p+1f, LIBC_NAMESPACE::shared::static_rounding::expf(
1.0f, FE_TONEAREST));
@@ -996,6 +1002,15 @@ TEST(LlvmLibcSharedMathTest, StaticRounding) {
EXPECT_FP_EQ(0x1.6a09e6p+0f, LIBC_NAMESPACE::shared::static_rounding::exp2f(
0.5f, FE_TOWARDZERO));
+ EXPECT_FP_EQ(0x1.94c584p+1f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 0.5f, FE_TONEAREST));
+ EXPECT_FP_EQ(0x1.94c584p+1f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 0.5f, FE_UPWARD));
+ EXPECT_FP_EQ(0x1.94c582p+1f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 0.5f, FE_DOWNWARD));
+ EXPECT_FP_EQ(0x1.94c582p+1f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ 0.5f, FE_TOWARDZERO));
+
int rounding_modes[] = {FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO};
for (int rm : rounding_modes) {
EXPECT_FP_EQ(1.0f, LIBC_NAMESPACE::shared::static_rounding::expf(0.0f, rm));
@@ -1005,6 +1020,14 @@ TEST(LlvmLibcSharedMathTest, StaticRounding) {
LIBC_NAMESPACE::shared::static_rounding::exp2f(0.0f, rm));
EXPECT_FP_EQ(1.0f,
LIBC_NAMESPACE::shared::static_rounding::exp2f(-0.0f, rm));
+ EXPECT_FP_EQ(1.0f,
+ LIBC_NAMESPACE::shared::static_rounding::exp10f(0.0f, rm));
+ EXPECT_FP_EQ(1.0f,
+ LIBC_NAMESPACE::shared::static_rounding::exp10f(-0.0f, rm));
+ EXPECT_FP_EQ(10.0f,
+ LIBC_NAMESPACE::shared::static_rounding::exp10f(1.0f, rm));
+ EXPECT_FP_EQ(1e10f,
+ LIBC_NAMESPACE::shared::static_rounding::exp10f(10.0f, rm));
EXPECT_TRUE(FPBits(LIBC_NAMESPACE::shared::static_rounding::expf(
FPBits::quiet_nan().get_val(), rm))
@@ -1012,6 +1035,9 @@ TEST(LlvmLibcSharedMathTest, StaticRounding) {
EXPECT_TRUE(FPBits(LIBC_NAMESPACE::shared::static_rounding::exp2f(
FPBits::quiet_nan().get_val(), rm))
.is_nan());
+ EXPECT_TRUE(FPBits(LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ FPBits::quiet_nan().get_val(), rm))
+ .is_nan());
EXPECT_FP_EQ(FPBits::inf(Sign::POS).get_val(),
LIBC_NAMESPACE::shared::static_rounding::expf(
@@ -1019,10 +1045,15 @@ TEST(LlvmLibcSharedMathTest, StaticRounding) {
EXPECT_FP_EQ(FPBits::inf(Sign::POS).get_val(),
LIBC_NAMESPACE::shared::static_rounding::exp2f(
FPBits::inf(Sign::POS).get_val(), rm));
+ EXPECT_FP_EQ(FPBits::inf(Sign::POS).get_val(),
+ LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ FPBits::inf(Sign::POS).get_val(), rm));
EXPECT_FP_EQ(0.0f, LIBC_NAMESPACE::shared::static_rounding::expf(
FPBits::inf(Sign::NEG).get_val(), rm));
EXPECT_FP_EQ(0.0f, LIBC_NAMESPACE::shared::static_rounding::exp2f(
FPBits::inf(Sign::NEG).get_val(), rm));
+ EXPECT_FP_EQ(0.0f, LIBC_NAMESPACE::shared::static_rounding::exp10f(
+ FPBits::inf(Sign::NEG).get_val(), rm));
}
}
diff --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt
index 7be0f192e5062c..3fc096f7bf39fb 100644
--- a/libc/test/src/math/CMakeLists.txt
+++ b/libc/test/src/math/CMakeLists.txt
@@ -1489,6 +1489,7 @@ add_fp_unittest(
libc.src.math.exp10f
libc.src.__support.math.exp10f_double_eval
libc.src.__support.math.exp10f_float_eval
+ libc.src.__support.math.exp10f_integer_eval
libc.src.__support.FPUtil.fp_bits
)
diff --git a/libc/test/src/math/exhaustive/CMakeLists.txt b/libc/test/src/math/exhaustive/CMakeLists.txt
index 743779b3d51c32..a72d14d34499df 100644
--- a/libc/test/src/math/exhaustive/CMakeLists.txt
+++ b/libc/test/src/math/exhaustive/CMakeLists.txt
@@ -275,8 +275,11 @@ add_fp_unittest(
exp10f_test.cpp
DEPENDS
.exhaustive_test
+ .exhaustive_test_static_rounding
libc.src.math.exp10f
+ libc.src.__support.math.exp10f_double_eval
libc.src.__support.math.exp10f_float_eval
+ libc.src.__support.math.exp10f_integer_eval
libc.src.__support.FPUtil.fp_bits
LINK_LIBRARIES
-lpthread
diff --git a/libc/test/src/math/exhaustive/exp10f_test.cpp b/libc/test/src/math/exhaustive/exp10f_test.cpp
index 150e3d0812b657..ce94bde611578f 100644
--- a/libc/test/src/math/exhaustive/exp10f_test.cpp
+++ b/libc/test/src/math/exhaustive/exp10f_test.cpp
@@ -6,9 +6,12 @@
//
//===----------------------------------------------------------------------===//
+#include "src/__support/math/exp10f_double_eval.h"
#include "src/__support/math/exp10f_float_eval.h"
+#include "src/__support/math/exp10f_integer_eval.h"
#include "src/math/exp10f.h"
#include "test/src/math/exhaustive/exhaustive_test.h"
+#include "test/src/math/exhaustive/exhaustive_test_static_rounding.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
@@ -41,7 +44,7 @@ static float exp10f_float_eval(float x) {
using LlvmLibcExp10fFloatExhaustiveTest =
LlvmLibcUnaryOpAgainstBaselineExhaustiveMathTest<
- float, LIBC_NAMESPACE::exp10f, exp10f_float_eval, 1>;
+ float, LIBC_NAMESPACE::math::double_eval::exp10f, exp10f_float_eval, 1>;
TEST_F(LlvmLibcExp10fFloatExhaustiveTest, PositiveRange) {
test_full_range(mpfr::RoundingMode::Nearest, POS_START, POS_STOP);
@@ -50,3 +53,18 @@ TEST_F(LlvmLibcExp10fFloatExhaustiveTest, PositiveRange) {
TEST_F(LlvmLibcExp10fFloatExhaustiveTest, NegativeRange) {
test_full_range(mpfr::RoundingMode::Nearest, NEG_START, NEG_STOP);
}
+
+// Statically rounded implementation: tested against double_eval across all
+// roundings.
+using LlvmLibcExp10fStaticRoundingExhaustiveTest =
+ LlvmLibcStaticallyRoundedUnaryOpExhaustiveMathTest<
+ float, LIBC_NAMESPACE::math::double_eval::exp10f,
+ LIBC_NAMESPACE::math::static_rounding::exp10f>;
+
+TEST_F(LlvmLibcExp10fStaticRoundingExhaustiveTest, PositiveRange) {
+ test_full_range_all_roundings(POS_START, POS_STOP);
+}
+
+TEST_F(LlvmLibcExp10fStaticRoundingExhaustiveTest, NegativeRange) {
+ test_full_range_all_roundings(NEG_START, NEG_STOP);
+}
diff --git a/libc/test/src/math/exp10f_test.cpp b/libc/test/src/math/exp10f_test.cpp
index 763c61a1c66c91..fdff6a4deaf5c0 100644
--- a/libc/test/src/math/exp10f_test.cpp
+++ b/libc/test/src/math/exp10f_test.cpp
@@ -20,6 +20,7 @@
#include "src/__support/macros/optimization.h"
#include "src/__support/math/exp10f_double_eval.h"
#include "src/__support/math/exp10f_float_eval.h"
+#include "src/__support/math/exp10f_integer_eval.h"
#include "src/math/exp10f.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
@@ -29,27 +30,33 @@ namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
class Exp10fTest : public LIBC_NAMESPACE::testing::FPTest<float> {
public:
- void test_special_numbers(float (*func)(float)) {
+ void test_special_numbers(float (*func)(float), bool check_errno = true) {
EXPECT_FP_EQ(aNaN, func(aNaN));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ(inf, func(inf));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ(0.0f, func(neg_inf));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ(1.0f, func(0.0f));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ(1.0f, func(-0.0f));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
}
void test_overflow(float (*func)(float),
bool check_exception_and_errno = true) {
constexpr float VALUES[] = {
FPBits(0x7f7fffffU).get_val(),
+ FPBits(0x421a209bU).get_val(),
FPBits(0x43000000U).get_val(),
FPBits(0x43000001U).get_val(),
};
@@ -74,20 +81,27 @@ class Exp10fTest : public LIBC_NAMESPACE::testing::FPTest<float> {
EXPECT_FP_EQ(0.0f, func(FPBits(0xff7fffffU).get_val()));
}
- constexpr float VALUES[] = {
- FPBits(0xc2cffff8U).get_val(),
- FPBits(0xc2d00008U).get_val(),
+ struct TestCase {
+ float x;
+ int expected_errno;
+ } cases[] = {
+ {FPBits(0xc2349e35U).get_val(), 0},
+ {FPBits(0xc2349e36U).get_val(), ERANGE},
+ {FPBits(0xc2cffff8U).get_val(), ERANGE},
+ {FPBits(0xc2d00008U).get_val(), ERANGE},
};
- for (float x : VALUES) {
+ for (const auto &c : cases) {
+ libc_errno = 0;
if (all_rounding) {
- EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10, x, func(x),
+ EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10, c.x, func(c.x),
ulp_tolerance);
} else {
- EXPECT_MPFR_MATCH(mpfr::Operation::Exp10, x, func(x), ulp_tolerance);
+ EXPECT_MPFR_MATCH(mpfr::Operation::Exp10, c.x, func(c.x),
+ ulp_tolerance);
}
if (check_exception_and_errno) {
- EXPECT_MATH_ERRNO(ERANGE);
+ EXPECT_MATH_ERRNO(c.expected_errno);
}
}
}
@@ -157,25 +171,44 @@ class Exp10fTest : public LIBC_NAMESPACE::testing::FPTest<float> {
}
};
-#define LIST_EXP10F_TESTS(suffix, func, ulp_tolerance, all_rounding) \
+#define LIST_EXP10F_TESTS(suffix, func, ulp_tolerance, all_rounding, \
+ check_exception_and_errno, check_errno) \
using LlvmLibcExp10fTest##suffix = Exp10fTest; \
TEST_F(LlvmLibcExp10fTest##suffix, SpecialNumbers) { \
- test_special_numbers(&func); \
+ test_special_numbers(&func, check_errno); \
+ } \
+ TEST_F(LlvmLibcExp10fTest##suffix, Overflow) { \
+ test_overflow(&func, check_exception_and_errno); \
} \
- TEST_F(LlvmLibcExp10fTest##suffix, Overflow) { test_overflow(&func); } \
TEST_F(LlvmLibcExp10fTest##suffix, Underflow) { \
- test_underflow(&func, ulp_tolerance, all_rounding); \
+ test_underflow(&func, ulp_tolerance, all_rounding, \
+ check_exception_and_errno); \
} \
TEST_F(LlvmLibcExp10fTest##suffix, TrickyInputs) { \
test_tricky_inputs(&func, ulp_tolerance, all_rounding); \
} \
TEST_F(LlvmLibcExp10fTest##suffix, InFloatRange) { \
- test_in_range(&func, ulp_tolerance, all_rounding); \
+ test_in_range(&func, ulp_tolerance, all_rounding, check_errno); \
}
LIST_EXP10F_TESTS(Default, LIBC_NAMESPACE::exp10f, /*ulp_tolerance=*/0.5,
- /*all_rounding=*/true)
+ /*all_rounding=*/true, /*check_exception_and_errno=*/true,
+ /*check_errno=*/true)
LIST_EXP10F_TESTS(DoubleEval, LIBC_NAMESPACE::math::double_eval::exp10f,
- /*ulp_tolerance=*/0.5, /*all_rounding=*/true)
+ /*ulp_tolerance=*/0.5, /*all_rounding=*/true,
+ /*check_exception_and_errno=*/true, /*check_errno=*/true)
LIST_EXP10F_TESTS(FloatEval, LIBC_NAMESPACE::math::float_eval::exp10f,
- /*ulp_tolerance=*/1.5, /*all_rounding=*/false)
+ /*ulp_tolerance=*/1.5, /*all_rounding=*/false,
+ /*check_exception_and_errno=*/true, /*check_errno=*/true)
+LIST_EXP10F_TESTS(IntegerEval, LIBC_NAMESPACE::math::integer_eval::exp10f,
+ /*ulp_tolerance=*/0.5, /*all_rounding=*/false,
+ /*check_exception_and_errno=*/false, /*check_errno=*/false)
+
+static float exp10f_static_rounding(float x) {
+ return LIBC_NAMESPACE::math::static_rounding::exp10f(
+ x, LIBC_NAMESPACE::fputil::quick_get_round());
+}
+
+LIST_EXP10F_TESTS(StaticRounding, exp10f_static_rounding,
+ /*ulp_tolerance=*/0.5, /*all_rounding=*/true,
+ /*check_exception_and_errno=*/false, /*check_errno=*/false)
diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt
index 436e864342beef..65ebae024e18c8 100644
--- a/libc/test/src/math/smoke/CMakeLists.txt
+++ b/libc/test/src/math/smoke/CMakeLists.txt
@@ -1626,6 +1626,7 @@ add_fp_unittest(
libc.src.math.exp10f
libc.src.__support.math.exp10f_double_eval
libc.src.__support.math.exp10f_float_eval
+ libc.src.__support.math.exp10f_integer_eval
libc.src.__support.FPUtil.fp_bits
)
diff --git a/libc/test/src/math/smoke/exp10f_test.cpp b/libc/test/src/math/smoke/exp10f_test.cpp
index 00c65dcf6acb96..eb5559dfdb5749 100644
--- a/libc/test/src/math/smoke/exp10f_test.cpp
+++ b/libc/test/src/math/smoke/exp10f_test.cpp
@@ -18,6 +18,7 @@
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/math/exp10f_double_eval.h"
#include "src/__support/math/exp10f_float_eval.h"
+#include "src/__support/math/exp10f_integer_eval.h"
#include "src/math/exp10f.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
@@ -25,28 +26,35 @@
class Exp10fTest : public LIBC_NAMESPACE::testing::FPTest<float> {
public:
void test_special_numbers(float (*func)(float),
- bool check_snan_invalid = false) {
+ bool check_snan_invalid = false,
+ bool check_errno = true) {
if (check_snan_invalid) {
EXPECT_FP_EQ_WITH_EXCEPTION(aNaN, func(sNaN), FE_INVALID);
} else {
EXPECT_FP_EQ(aNaN, func(sNaN));
}
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ_ALL_ROUNDING(aNaN, func(aNaN));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ_ALL_ROUNDING(inf, func(inf));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ_ALL_ROUNDING(0.0f, func(neg_inf));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ_ALL_ROUNDING(1.0f, func(0.0f));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ_ALL_ROUNDING(1.0f, func(-0.0f));
- EXPECT_MATH_ERRNO(0);
+ if (check_errno)
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_EQ_ALL_ROUNDING(10.0f, func(1.0f));
EXPECT_FP_EQ_ALL_ROUNDING(100.0f, func(2.0f));
@@ -57,6 +65,7 @@ class Exp10fTest : public LIBC_NAMESPACE::testing::FPTest<float> {
bool check_exception_and_errno = true) {
constexpr float VALUES[] = {
FPBits(0x7f7fffffU).get_val(),
+ FPBits(0x421a209bU).get_val(),
FPBits(0x43000000U).get_val(),
FPBits(0x43000001U).get_val(),
};
@@ -97,16 +106,34 @@ class Exp10fTest : public LIBC_NAMESPACE::testing::FPTest<float> {
#define LIST_EXP10F_FTZ_DAZ_TESTS(suffix, func)
#endif // LIBC_TEST_FTZ_DAZ
-#define LIST_EXP10F_TESTS(suffix, func, check_snan_invalid) \
+#define LIST_EXP10F_TESTS(suffix, func, check_snan_invalid, \
+ check_exception_and_errno, check_errno) \
using LlvmLibcExp10fTest##suffix = Exp10fTest; \
TEST_F(LlvmLibcExp10fTest##suffix, SpecialNumbers) { \
- test_special_numbers(&func, check_snan_invalid); \
+ test_special_numbers(&func, check_snan_invalid, check_errno); \
+ } \
+ TEST_F(LlvmLibcExp10fTest##suffix, Overflow) { \
+ test_overflow(&func, check_exception_and_errno); \
} \
- TEST_F(LlvmLibcExp10fTest##suffix, Overflow) { test_overflow(&func); } \
LIST_EXP10F_FTZ_DAZ_TESTS(suffix, func)
-LIST_EXP10F_TESTS(Default, LIBC_NAMESPACE::exp10f, /*check_snan_invalid=*/true)
+LIST_EXP10F_TESTS(Default, LIBC_NAMESPACE::exp10f, /*check_snan_invalid=*/true,
+ /*check_exception_and_errno=*/true, /*check_errno=*/true)
LIST_EXP10F_TESTS(DoubleEval, LIBC_NAMESPACE::math::double_eval::exp10f,
- /*check_snan_invalid=*/false)
+ /*check_snan_invalid=*/false,
+ /*check_exception_and_errno=*/true, /*check_errno=*/true)
LIST_EXP10F_TESTS(FloatEval, LIBC_NAMESPACE::math::float_eval::exp10f,
- /*check_snan_invalid=*/false)
+ /*check_snan_invalid=*/false,
+ /*check_exception_and_errno=*/true, /*check_errno=*/true)
+LIST_EXP10F_TESTS(IntegerEval, LIBC_NAMESPACE::math::integer_eval::exp10f,
+ /*check_snan_invalid=*/false,
+ /*check_exception_and_errno=*/false, /*check_errno=*/false)
+
+static float exp10f_static_rounding(float x) {
+ return LIBC_NAMESPACE::math::static_rounding::exp10f(
+ x, LIBC_NAMESPACE::fputil::quick_get_round());
+}
+
+LIST_EXP10F_TESTS(StaticRounding, exp10f_static_rounding,
+ /*check_snan_invalid=*/false,
+ /*check_exception_and_errno=*/false, /*check_errno=*/false)
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index bdae359342bb71..b8289c87fed7d3 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -11845,6 +11845,32 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_math_exp10f_integer_eval",
+ hdrs = ["src/__support/math/exp10f_integer_eval.h"],
+ deps = [
+ ":__support_cpp_bit",
+ ":__support_fputil_fp_bits",
+ ":__support_frac64",
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":__support_macros_optimization",
+ ":__support_math_exp2f_integer_utils",
+ ":hdr_fenv_macros",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_static_rounding_exp10f",
+ hdrs = ["shared/math/static_rounding/exp10f.h"],
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":__support_math_exp10f_integer_eval",
+ ":shared_libc_common",
+ ],
+)
+
libc_support_library(
name = "__support_math_exp10f",
hdrs = ["src/__support/math/exp10f.h"],
@@ -11855,6 +11881,7 @@ libc_support_library(
":__support_macros_properties_cpu_features",
":__support_math_exp10f_double_eval",
":__support_math_exp10f_float_eval",
+ ":__support_math_exp10f_integer_eval",
],
)
@@ -14201,6 +14228,7 @@ libc_math_function(
name = "exp10f",
additional_deps = [
":__support_math_exp10f",
+ ":__support_math_static_rounding_exp10f",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index 0f5e3a7043b9d0..5ba74aff0556cf 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -286,6 +286,7 @@ math_mpfr_test(
deps = [
"//libc:__support_math_exp10f_double_eval",
"//libc:__support_math_exp10f_float_eval",
+ "//libc:__support_math_exp10f_integer_eval",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
index b9941945f70242..71cf81a1ab143d 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
@@ -620,6 +620,7 @@ math_test(
deps = [
"//libc:__support_math_exp10f_double_eval",
"//libc:__support_math_exp10f_float_eval",
+ "//libc:__support_math_exp10f_integer_eval",
],
)
>From 3efc690be7831fc7db6a85c9c197b78d5d38bb67 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Sat, 14 Nov 2026 15:00:54 +0000
Subject: [PATCH 2/2] Add missing headers
---
libc/shared/math/static_rounding/exp10f.h | 1 +
libc/src/__support/math/CMakeLists.txt | 1 +
libc/src/__support/math/exp10f_integer_eval.h | 1 +
libc/test/src/math/CMakeLists.txt | 5 +++++
libc/test/src/math/exhaustive/CMakeLists.txt | 2 +-
libc/test/src/math/exhaustive/exp10f_test.cpp | 8 +++++++-
libc/test/src/math/exp10f_test.cpp | 1 +
libc/test/src/math/smoke/CMakeLists.txt | 3 +++
libc/test/src/math/smoke/exp10f_test.cpp | 1 +
utils/bazel/llvm-project-overlay/libc/BUILD.bazel | 1 +
.../llvm-project-overlay/libc/test/src/math/BUILD.bazel | 1 +
.../libc/test/src/math/smoke/BUILD.bazel | 1 +
12 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/libc/shared/math/static_rounding/exp10f.h b/libc/shared/math/static_rounding/exp10f.h
index 923e6cc67960df..b5cbf382060ecb 100644
--- a/libc/shared/math/static_rounding/exp10f.h
+++ b/libc/shared/math/static_rounding/exp10f.h
@@ -15,6 +15,7 @@
#define LLVM_LIBC_SHARED_MATH_STATIC_ROUNDING_EXP10F_H
#include "shared/libc_common.h"
+#include "src/__support/macros/config.h"
#include "src/__support/math/exp10f_integer_eval.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/__support/math/CMakeLists.txt b/libc/src/__support/math/CMakeLists.txt
index 4b8123cfca36d9..329e52667d0166 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -4754,6 +4754,7 @@ add_header_library(
DEPENDS
.exp2f_integer_utils
libc.hdr.fenv_macros
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.FPUtil.fp_bits
libc.src.__support.frac64
diff --git a/libc/src/__support/math/exp10f_integer_eval.h b/libc/src/__support/math/exp10f_integer_eval.h
index 5df88356639d08..2aeb4ed0957da1 100644
--- a/libc/src/__support/math/exp10f_integer_eval.h
+++ b/libc/src/__support/math/exp10f_integer_eval.h
@@ -15,6 +15,7 @@
#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP10F_INTEGER_EVAL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/frac64.h"
diff --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt
index 3fc096f7bf39fb..ecef5c960cb864 100644
--- a/libc/test/src/math/CMakeLists.txt
+++ b/libc/test/src/math/CMakeLists.txt
@@ -1486,11 +1486,16 @@ add_fp_unittest(
DEPENDS
libc.hdr.errno_macros
libc.hdr.fenv_macros
+ libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.math.exp10f
libc.src.__support.math.exp10f_double_eval
libc.src.__support.math.exp10f_float_eval
libc.src.__support.math.exp10f_integer_eval
libc.src.__support.FPUtil.fp_bits
+ libc.src.__support.FPUtil.rounding_mode
+ libc.src.__support.libc_errno
+ libc.src.__support.macros.optimization
)
add_fp_unittest(
diff --git a/libc/test/src/math/exhaustive/CMakeLists.txt b/libc/test/src/math/exhaustive/CMakeLists.txt
index a72d14d34499df..cfe1033db10434 100644
--- a/libc/test/src/math/exhaustive/CMakeLists.txt
+++ b/libc/test/src/math/exhaustive/CMakeLists.txt
@@ -276,11 +276,11 @@ add_fp_unittest(
DEPENDS
.exhaustive_test
.exhaustive_test_static_rounding
+ libc.hdr.stdint_proxy
libc.src.math.exp10f
libc.src.__support.math.exp10f_double_eval
libc.src.__support.math.exp10f_float_eval
libc.src.__support.math.exp10f_integer_eval
- libc.src.__support.FPUtil.fp_bits
LINK_LIBRARIES
-lpthread
)
diff --git a/libc/test/src/math/exhaustive/exp10f_test.cpp b/libc/test/src/math/exhaustive/exp10f_test.cpp
index ce94bde611578f..1e106073b6d8ca 100644
--- a/libc/test/src/math/exhaustive/exp10f_test.cpp
+++ b/libc/test/src/math/exhaustive/exp10f_test.cpp
@@ -1,11 +1,17 @@
-//===-- Exhaustive test for exp10f ----------------------------------------===//
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Exhaustive test for exp10f.
+///
+//===----------------------------------------------------------------------===//
+#include "hdr/stdint_proxy.h"
#include "src/__support/math/exp10f_double_eval.h"
#include "src/__support/math/exp10f_float_eval.h"
#include "src/__support/math/exp10f_integer_eval.h"
diff --git a/libc/test/src/math/exp10f_test.cpp b/libc/test/src/math/exp10f_test.cpp
index fdff6a4deaf5c0..798f1dc766c4c6 100644
--- a/libc/test/src/math/exp10f_test.cpp
+++ b/libc/test/src/math/exp10f_test.cpp
@@ -16,6 +16,7 @@
#include "hdr/math_macros.h"
#include "hdr/stdint_proxy.h"
#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/optimization.h"
#include "src/__support/math/exp10f_double_eval.h"
diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt
index 65ebae024e18c8..5c8641b8ffda8c 100644
--- a/libc/test/src/math/smoke/CMakeLists.txt
+++ b/libc/test/src/math/smoke/CMakeLists.txt
@@ -1623,11 +1623,14 @@ add_fp_unittest(
DEPENDS
libc.hdr.errno_macros
libc.hdr.fenv_macros
+ libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.math.exp10f
libc.src.__support.math.exp10f_double_eval
libc.src.__support.math.exp10f_float_eval
libc.src.__support.math.exp10f_integer_eval
libc.src.__support.FPUtil.fp_bits
+ libc.src.__support.FPUtil.rounding_mode
)
add_fp_unittest(
diff --git a/libc/test/src/math/smoke/exp10f_test.cpp b/libc/test/src/math/smoke/exp10f_test.cpp
index eb5559dfdb5749..fbd137daf3beef 100644
--- a/libc/test/src/math/smoke/exp10f_test.cpp
+++ b/libc/test/src/math/smoke/exp10f_test.cpp
@@ -16,6 +16,7 @@
#include "hdr/math_macros.h"
#include "hdr/stdint_proxy.h"
#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/math/exp10f_double_eval.h"
#include "src/__support/math/exp10f_float_eval.h"
#include "src/__support/math/exp10f_integer_eval.h"
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index b8289c87fed7d3..9a644bbe332930 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -11857,6 +11857,7 @@ libc_support_library(
":__support_macros_optimization",
":__support_math_exp2f_integer_utils",
":hdr_fenv_macros",
+ ":hdr_stdint_proxy",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index 5ba74aff0556cf..298945e026a895 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -284,6 +284,7 @@ math_mpfr_test(
math_mpfr_test(
name = "exp10f",
deps = [
+ "//libc:__support_fputil_rounding_mode",
"//libc:__support_math_exp10f_double_eval",
"//libc:__support_math_exp10f_float_eval",
"//libc:__support_math_exp10f_integer_eval",
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
index 71cf81a1ab143d..c4cfa216e16ed9 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
@@ -618,6 +618,7 @@ math_test(
math_test(
name = "exp10f",
deps = [
+ "//libc:__support_fputil_rounding_mode",
"//libc:__support_math_exp10f_double_eval",
"//libc:__support_math_exp10f_float_eval",
"//libc:__support_math_exp10f_integer_eval",
More information about the libc-commits
mailing list