[libc-commits] [libc] 0a0e6fc - [libc][mathvec] Explicitly test against scalar double precision versions for exp*f. (#224854)
via libc-commits
libc-commits at lists.llvm.org
Sat Sep 19 12:30:13 PDT 2026
Author: lntue
Date: 2026-09-19T19:30:08Z
New Revision: 0a0e6fce450fdd2b543367511c9513b6f38d47c0
URL: https://github.com/llvm/llvm-project/commit/0a0e6fce450fdd2b543367511c9513b6f38d47c0
DIFF: https://github.com/llvm/llvm-project/commit/0a0e6fce450fdd2b543367511c9513b6f38d47c0.diff
LOG: [libc][mathvec] Explicitly test against scalar double precision versions for exp*f. (#224854)
This fixes mathvec tests failures on amdgpu for
https://github.com/llvm/llvm-project/pull/224735.
Added:
Modified:
libc/test/src/mathvec/CMakeLists.txt
libc/test/src/mathvec/exhaustive/CMakeLists.txt
libc/test/src/mathvec/exhaustive/exp10f_test.cpp
libc/test/src/mathvec/exhaustive/exp2f_test.cpp
libc/test/src/mathvec/exhaustive/expf_test.cpp
libc/test/src/mathvec/exp10f_test.cpp
libc/test/src/mathvec/exp2f_test.cpp
libc/test/src/mathvec/expf_test.cpp
Removed:
################################################################################
diff --git a/libc/test/src/mathvec/CMakeLists.txt b/libc/test/src/mathvec/CMakeLists.txt
index 1a49297a5d9dc..85a3e09bd2252 100644
--- a/libc/test/src/mathvec/CMakeLists.txt
+++ b/libc/test/src/mathvec/CMakeLists.txt
@@ -241,8 +241,8 @@ add_fp_unittest(
exp2f_test.cpp
DEPENDS
.unit_test_wrappers
- libc.src.math.exp2f
libc.src.mathvec.exp2f
+ libc.src.__support.math.exp2f_double_eval
libc.src.__support.FPUtil.fp_bits
libc.src.__support.CPP.simd
FLAGS
@@ -275,8 +275,8 @@ add_fp_unittest(
exp10f_test.cpp
DEPENDS
.unit_test_wrappers
- libc.src.math.exp10f
libc.src.mathvec.exp10f
+ libc.src.__support.math.exp10f_double_eval
libc.src.__support.FPUtil.fp_bits
libc.src.__support.CPP.simd
FLAGS
@@ -309,8 +309,8 @@ add_fp_unittest(
expf_test.cpp
DEPENDS
.unit_test_wrappers
- libc.src.math.expf
libc.src.mathvec.expf
+ libc.src.__support.math.expf_double_eval
libc.src.__support.FPUtil.fp_bits
libc.src.__support.CPP.simd
FLAGS
diff --git a/libc/test/src/mathvec/exhaustive/CMakeLists.txt b/libc/test/src/mathvec/exhaustive/CMakeLists.txt
index 1d986125bff19..bebbb42164d49 100644
--- a/libc/test/src/mathvec/exhaustive/CMakeLists.txt
+++ b/libc/test/src/mathvec/exhaustive/CMakeLists.txt
@@ -226,8 +226,8 @@ add_fp_unittest(
exp2f_test.cpp
DEPENDS
.exhaustive_test
- libc.src.math.exp2f
libc.src.mathvec.exp2f
+ libc.src.__support.math.exp2f_double_eval
libc.src.__support.CPP.simd
LINK_LIBRARIES
-lpthread
@@ -258,8 +258,8 @@ add_fp_unittest(
exp10f_test.cpp
DEPENDS
.exhaustive_test
- libc.src.math.exp10f
libc.src.mathvec.exp10f
+ libc.src.__support.math.exp10f_double_eval
libc.src.__support.CPP.simd
LINK_LIBRARIES
-lpthread
@@ -290,8 +290,8 @@ add_fp_unittest(
expf_test.cpp
DEPENDS
.exhaustive_test
- libc.src.math.expf
libc.src.mathvec.expf
+ libc.src.__support.math.expf_double_eval
libc.src.__support.CPP.simd
LINK_LIBRARIES
-lpthread
diff --git a/libc/test/src/mathvec/exhaustive/exp10f_test.cpp b/libc/test/src/mathvec/exhaustive/exp10f_test.cpp
index bd1cb3dce7055..0d4e05410879f 100644
--- a/libc/test/src/mathvec/exhaustive/exp10f_test.cpp
+++ b/libc/test/src/mathvec/exhaustive/exp10f_test.cpp
@@ -13,12 +13,11 @@
#include "exhaustive_test.h"
#include "src/__support/CPP/simd.h"
-#include "src/math/exp10f.h"
+#include "src/__support/math/exp10f_double_eval.h"
#include "src/mathvec/exp10f.h"
-using LlvmLibcExp10fExhaustiveTest =
- LlvmLibcUnaryOpExhaustiveMathvecTest<float, LIBC_NAMESPACE::exp10f,
- LIBC_NAMESPACE::exp10f>;
+using LlvmLibcExp10fExhaustiveTest = LlvmLibcUnaryOpExhaustiveMathvecTest<
+ float, LIBC_NAMESPACE::math::double_eval::exp10f, LIBC_NAMESPACE::exp10f>;
// Tests all possible 32-bit input patterns
TEST_F(LlvmLibcExp10fExhaustiveTest, EntireRange) { test_full_range_RN(); }
diff --git a/libc/test/src/mathvec/exhaustive/exp2f_test.cpp b/libc/test/src/mathvec/exhaustive/exp2f_test.cpp
index c7551b37df988..b678040951c70 100644
--- a/libc/test/src/mathvec/exhaustive/exp2f_test.cpp
+++ b/libc/test/src/mathvec/exhaustive/exp2f_test.cpp
@@ -13,12 +13,11 @@
#include "exhaustive_test.h"
#include "src/__support/CPP/simd.h"
-#include "src/math/exp2f.h"
+#include "src/__support/math/exp2f_double_eval.h"
#include "src/mathvec/exp2f.h"
-using LlvmLibcExp2fExhaustiveTest =
- LlvmLibcUnaryOpExhaustiveMathvecTest<float, LIBC_NAMESPACE::exp2f,
- LIBC_NAMESPACE::exp2f>;
+using LlvmLibcExp2fExhaustiveTest = LlvmLibcUnaryOpExhaustiveMathvecTest<
+ float, LIBC_NAMESPACE::math::double_eval::exp2f, LIBC_NAMESPACE::exp2f>;
// Tests all possible 32-bit input patterns
TEST_F(LlvmLibcExp2fExhaustiveTest, EntireRange) { test_full_range_RN(); }
diff --git a/libc/test/src/mathvec/exhaustive/expf_test.cpp b/libc/test/src/mathvec/exhaustive/expf_test.cpp
index 302298b5f0a5a..f1b23786bfc30 100644
--- a/libc/test/src/mathvec/exhaustive/expf_test.cpp
+++ b/libc/test/src/mathvec/exhaustive/expf_test.cpp
@@ -13,12 +13,11 @@
#include "exhaustive_test.h"
#include "src/__support/CPP/simd.h"
-#include "src/math/expf.h"
+#include "src/__support/math/expf_double_eval.h"
#include "src/mathvec/expf.h"
-using LlvmLibcExpfExhaustiveTest =
- LlvmLibcUnaryOpExhaustiveMathvecTest<float, LIBC_NAMESPACE::expf,
- LIBC_NAMESPACE::expf>;
+using LlvmLibcExpfExhaustiveTest = LlvmLibcUnaryOpExhaustiveMathvecTest<
+ float, LIBC_NAMESPACE::math::double_eval::expf, LIBC_NAMESPACE::expf>;
// Tests all possible 32-bit input patterns
TEST_F(LlvmLibcExpfExhaustiveTest, EntireRange) { test_full_range_RN(); }
diff --git a/libc/test/src/mathvec/exp10f_test.cpp b/libc/test/src/mathvec/exp10f_test.cpp
index 90984f6489982..a66cd0280122c 100644
--- a/libc/test/src/mathvec/exp10f_test.cpp
+++ b/libc/test/src/mathvec/exp10f_test.cpp
@@ -14,7 +14,7 @@
#include "hdr/math_macros.h"
#include "src/__support/CPP/simd.h"
#include "src/__support/FPUtil/FPBits.h"
-#include "src/math/exp10f.h"
+#include "src/__support/math/exp10f_double_eval.h"
#include "src/mathvec/exp10f.h"
#include "test/UnitTest/Test.h"
#include "test/src/mathvec/UnitTestWrappers.h"
@@ -23,9 +23,8 @@
using LlvmLibcVecExp10fTest = LIBC_NAMESPACE::testing::FPTest<float>;
-using Exp10fOp =
- LIBC_NAMESPACE::testing::mathvec::UnaryOp<float, LIBC_NAMESPACE::exp10f,
- LIBC_NAMESPACE::exp10f>;
+using Exp10fOp = LIBC_NAMESPACE::testing::mathvec::UnaryOp<
+ float, LIBC_NAMESPACE::math::double_eval::exp10f, LIBC_NAMESPACE::exp10f>;
using LIBC_NAMESPACE::cpp::splat;
using LIBC_NAMESPACE::testing::mathvec::wrap_ref;
using LIBC_NAMESPACE::testing::mathvec::wrap_vector;
diff --git a/libc/test/src/mathvec/exp2f_test.cpp b/libc/test/src/mathvec/exp2f_test.cpp
index 2b6504c62d9b3..770a4c6fef893 100644
--- a/libc/test/src/mathvec/exp2f_test.cpp
+++ b/libc/test/src/mathvec/exp2f_test.cpp
@@ -14,7 +14,7 @@
#include "hdr/math_macros.h"
#include "src/__support/CPP/simd.h"
#include "src/__support/FPUtil/FPBits.h"
-#include "src/math/exp2f.h"
+#include "src/__support/math/exp2f_double_eval.h"
#include "src/mathvec/exp2f.h"
#include "test/UnitTest/Test.h"
#include "test/src/mathvec/UnitTestWrappers.h"
@@ -23,9 +23,8 @@
using LlvmLibcVecExp2fTest = LIBC_NAMESPACE::testing::FPTest<float>;
-using Exp2fOp =
- LIBC_NAMESPACE::testing::mathvec::UnaryOp<float, LIBC_NAMESPACE::exp2f,
- LIBC_NAMESPACE::exp2f>;
+using Exp2fOp = LIBC_NAMESPACE::testing::mathvec::UnaryOp<
+ float, LIBC_NAMESPACE::math::double_eval::exp2f, LIBC_NAMESPACE::exp2f>;
using LIBC_NAMESPACE::cpp::splat;
using LIBC_NAMESPACE::testing::mathvec::wrap_ref;
using LIBC_NAMESPACE::testing::mathvec::wrap_vector;
diff --git a/libc/test/src/mathvec/expf_test.cpp b/libc/test/src/mathvec/expf_test.cpp
index ecb9fcfad8b0f..18b6b398b5b6c 100644
--- a/libc/test/src/mathvec/expf_test.cpp
+++ b/libc/test/src/mathvec/expf_test.cpp
@@ -14,7 +14,7 @@
#include "hdr/math_macros.h"
#include "src/__support/CPP/simd.h"
#include "src/__support/FPUtil/FPBits.h"
-#include "src/math/expf.h"
+#include "src/__support/math/expf_double_eval.h"
#include "src/mathvec/expf.h"
#include "test/UnitTest/Test.h"
#include "test/src/mathvec/UnitTestWrappers.h"
@@ -23,9 +23,8 @@
using LlvmLibcVecExpfTest = LIBC_NAMESPACE::testing::FPTest<float>;
-using ExpfOp =
- LIBC_NAMESPACE::testing::mathvec::UnaryOp<float, LIBC_NAMESPACE::expf,
- LIBC_NAMESPACE::expf>;
+using ExpfOp = LIBC_NAMESPACE::testing::mathvec::UnaryOp<
+ float, LIBC_NAMESPACE::math::double_eval::expf, LIBC_NAMESPACE::expf>;
using LIBC_NAMESPACE::cpp::splat;
using LIBC_NAMESPACE::testing::mathvec::wrap_ref;
using LIBC_NAMESPACE::testing::mathvec::wrap_vector;
More information about the libc-commits
mailing list