Skip to content

Commit 52e5889

Browse files
[libc] Enable exp10m1f on RISC-V (#138768)
Previously, the test failed due to isnan() and isinf() not being defined. This patch follows other tests in the same directory and calls isnan and isinf from the FBits class. --------- Co-authored-by: OverMighty <[email protected]>
1 parent 8d9f516 commit 52e5889

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libc/config/linux/riscv/entrypoints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ set(TARGET_LIBM_ENTRYPOINTS
451451
libc.src.math.exp
452452
libc.src.math.exp10
453453
libc.src.math.exp10f
454-
# libc.src.math.exp10m1f
454+
libc.src.math.exp10m1f
455455
libc.src.math.exp2
456456
libc.src.math.exp2f
457457
libc.src.math.exp2m1f

libc/test/src/math/exp10m1f_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ TEST_F(LlvmLibcExp10m1fTest, InFloatRange) {
8080
constexpr uint32_t STEP = UINT32_MAX / COUNT;
8181
for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
8282
float x = FPBits(v).get_val();
83-
if (isnan(x) || isinf(x))
83+
if (FPBits(v).is_inf_or_nan())
8484
continue;
8585
LIBC_NAMESPACE::libc_errno = 0;
8686
float result = LIBC_NAMESPACE::exp10m1f(x);
@@ -89,7 +89,7 @@ TEST_F(LlvmLibcExp10m1fTest, InFloatRange) {
8989
// in the single-precision floating point range, then ignore comparing with
9090
// MPFR result as MPFR can still produce valid results because of its
9191
// wider precision.
92-
if (isnan(result) || isinf(result) || LIBC_NAMESPACE::libc_errno != 0)
92+
if (FPBits(result).is_inf_or_nan() || LIBC_NAMESPACE::libc_errno != 0)
9393
continue;
9494
ASSERT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Exp10m1, x,
9595
LIBC_NAMESPACE::exp10m1f(x), 0.5);

0 commit comments

Comments
 (0)