[libc-commits] [libc] [libc][NFC] Reduce the test size for math functions by default. (PR #199308)
via libc-commits
libc-commits at lists.llvm.org
Fri May 22 18:15:33 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: lntue
<details>
<summary>Changes</summary>
---
Patch is 54.36 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/199308.diff
86 Files Affected:
- (modified) libc/test/src/math/AddTest.h (+2-2)
- (modified) libc/test/src/math/CeilTest.h (+1-1)
- (modified) libc/test/src/math/CopySignTest.h (+1-1)
- (modified) libc/test/src/math/DivTest.h (+2-2)
- (modified) libc/test/src/math/FAbsTest.h (+1-1)
- (modified) libc/test/src/math/FDimTest.h (+1-1)
- (modified) libc/test/src/math/FMaxTest.h (+1-1)
- (modified) libc/test/src/math/FMinTest.h (+1-1)
- (modified) libc/test/src/math/FloorTest.h (+1-1)
- (modified) libc/test/src/math/FmaTest.h (+2-2)
- (modified) libc/test/src/math/FrexpTest.h (+1-1)
- (modified) libc/test/src/math/HypotTest.h (+2-2)
- (modified) libc/test/src/math/ILogbTest.h (+2-2)
- (modified) libc/test/src/math/LogbTest.h (+1-1)
- (modified) libc/test/src/math/ModfTest.h (+1-1)
- (modified) libc/test/src/math/MulTest.h (+2-2)
- (modified) libc/test/src/math/NearbyIntTest.h (+2-2)
- (modified) libc/test/src/math/RIntTest.h (+2-2)
- (modified) libc/test/src/math/RemQuoTest.h (+2-2)
- (modified) libc/test/src/math/RoundEvenTest.h (+1-1)
- (modified) libc/test/src/math/RoundTest.h (+1-1)
- (modified) libc/test/src/math/RoundToIntegerTest.h (+2-2)
- (modified) libc/test/src/math/RsqrtTest.h (+2-2)
- (modified) libc/test/src/math/SqrtTest.h (+2-2)
- (modified) libc/test/src/math/SubTest.h (+2-2)
- (modified) libc/test/src/math/TruncTest.h (+1-1)
- (modified) libc/test/src/math/acos_test.cpp (+1-1)
- (modified) libc/test/src/math/acosf_test.cpp (+1-1)
- (modified) libc/test/src/math/acoshf_test.cpp (+1-1)
- (modified) libc/test/src/math/acospif_test.cpp (+1-1)
- (modified) libc/test/src/math/asin_test.cpp (+1-1)
- (modified) libc/test/src/math/asinf_test.cpp (+1-1)
- (modified) libc/test/src/math/asinhf_test.cpp (+1-1)
- (modified) libc/test/src/math/asinpi_test.cpp (+1-1)
- (modified) libc/test/src/math/asinpif_test.cpp (+1-1)
- (modified) libc/test/src/math/atan_test.cpp (+1-1)
- (modified) libc/test/src/math/atanf_test.cpp (+1-1)
- (modified) libc/test/src/math/atanhf_test.cpp (+1-1)
- (modified) libc/test/src/math/cbrt_test.cpp (+1-1)
- (modified) libc/test/src/math/cbrtf_test.cpp (+1-1)
- (modified) libc/test/src/math/cos_test.cpp (+1-1)
- (modified) libc/test/src/math/cosf_float_test.cpp (+1-1)
- (modified) libc/test/src/math/cosf_test.cpp (+1-1)
- (modified) libc/test/src/math/coshf_test.cpp (+1-1)
- (modified) libc/test/src/math/erff_test.cpp (+1-1)
- (modified) libc/test/src/math/exp10f_test.cpp (+1-1)
- (modified) libc/test/src/math/exp10m1f_test.cpp (+1-1)
- (modified) libc/test/src/math/exp2f_test.cpp (+1-1)
- (modified) libc/test/src/math/exp2m1f_test.cpp (+1-1)
- (modified) libc/test/src/math/expf_test.cpp (+1-1)
- (modified) libc/test/src/math/expm1f_test.cpp (+1-1)
- (modified) libc/test/src/math/log10_test.cpp (+1-1)
- (modified) libc/test/src/math/log10f_test.cpp (+1-1)
- (modified) libc/test/src/math/log1p_test.cpp (+1-1)
- (modified) libc/test/src/math/log1pf_test.cpp (+1-1)
- (modified) libc/test/src/math/log2_test.cpp (+1-1)
- (modified) libc/test/src/math/log2f_test.cpp (+1-1)
- (modified) libc/test/src/math/log_test.cpp (+1-1)
- (modified) libc/test/src/math/logf_test.cpp (+1-1)
- (modified) libc/test/src/math/sin_test.cpp (+1-1)
- (modified) libc/test/src/math/sincos_test.cpp (+1-1)
- (modified) libc/test/src/math/sincosf_test.cpp (+1-1)
- (modified) libc/test/src/math/sinf_float_test.cpp (+1-1)
- (modified) libc/test/src/math/sinf_test.cpp (+1-1)
- (modified) libc/test/src/math/sinhf_test.cpp (+1-1)
- (modified) libc/test/src/math/smoke/CopySignTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FDimTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMaxTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMaximumMagNumTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMaximumMagTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMaximumNumTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMaximumTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMinTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMinimumMagNumTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMinimumMagTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMinimumNumTest.h (+1-1)
- (modified) libc/test/src/math/smoke/FMinimumTest.h (+1-1)
- (modified) libc/test/src/math/smoke/ILogbTest.h (+2-2)
- (modified) libc/test/src/math/smoke/LogbTest.h (+1-1)
- (modified) libc/test/src/math/smoke/ModfTest.h (+1-1)
- (modified) libc/test/src/math/smoke/RoundToIntegerTest.h (+1-1)
- (modified) libc/test/src/math/tan_test.cpp (+1-1)
- (modified) libc/test/src/math/tanf_test.cpp (+1-1)
- (modified) libc/test/src/math/tanhf_test.cpp (+1-1)
- (modified) libc/test/src/mathvec/expf_test.cpp (+1-1)
- (modified) libc/test/utils/FPUtil/x86_long_double_test.cpp (+1-1)
``````````diff
diff --git a/libc/test/src/math/AddTest.h b/libc/test/src/math/AddTest.h
index 370cc2bbde8b3..4105add4ef4ab 100644
--- a/libc/test/src/math/AddTest.h
+++ b/libc/test/src/math/AddTest.h
@@ -40,7 +40,7 @@ class AddTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using AddFunc = OutType (*)(InType, InType);
void test_subnormal_range(AddFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
constexpr InStorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<InStorageType>((IN_MAX_SUBNORMAL_U - IN_MIN_SUBNORMAL_U) /
COUNT),
@@ -57,7 +57,7 @@ class AddTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(AddFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
constexpr InStorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<InStorageType>((IN_MAX_NORMAL_U - IN_MIN_NORMAL_U) / COUNT),
InStorageType(1));
diff --git a/libc/test/src/math/CeilTest.h b/libc/test/src/math/CeilTest.h
index 3af87420a739f..d30bd200b02ba 100644
--- a/libc/test/src/math/CeilTest.h
+++ b/libc/test/src/math/CeilTest.h
@@ -70,7 +70,7 @@ class CeilTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(CeilFunc func) {
- constexpr int COUNT = 100'000;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>(STORAGE_MAX / COUNT), StorageType(1));
StorageType v = 0;
diff --git a/libc/test/src/math/CopySignTest.h b/libc/test/src/math/CopySignTest.h
index 7c46d1bbf134f..d23ad933a1c89 100644
--- a/libc/test/src/math/CopySignTest.h
+++ b/libc/test/src/math/CopySignTest.h
@@ -35,7 +35,7 @@ class CopySignTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(CopySignFunc func) {
- constexpr StorageType COUNT = 100'000;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
T x = FPBits(v).get_val();
diff --git a/libc/test/src/math/DivTest.h b/libc/test/src/math/DivTest.h
index c14d16fb5773b..b990484cdcfce 100644
--- a/libc/test/src/math/DivTest.h
+++ b/libc/test/src/math/DivTest.h
@@ -39,7 +39,7 @@ class DivTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using DivFunc = OutType (*)(InType, InType);
void test_subnormal_range(DivFunc func) {
- constexpr InStorageType COUNT = 100'001;
+ constexpr InStorageType COUNT = 1'231;
constexpr InStorageType STEP =
(IN_MAX_SUBNORMAL_U - IN_MIN_SUBNORMAL_U) / COUNT;
for (InStorageType i = 0, v = 0, w = IN_MAX_SUBNORMAL_U; i <= COUNT;
@@ -53,7 +53,7 @@ class DivTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(DivFunc func) {
- constexpr InStorageType COUNT = 100'001;
+ constexpr InStorageType COUNT = 1'231;
constexpr InStorageType STEP = (IN_MAX_NORMAL_U - IN_MIN_NORMAL_U) / COUNT;
for (InStorageType i = 0, v = 0, w = IN_MAX_NORMAL_U; i <= COUNT;
++i, v += STEP, w -= STEP) {
diff --git a/libc/test/src/math/FAbsTest.h b/libc/test/src/math/FAbsTest.h
index 7b4ea93e4db99..b3188d0310b87 100644
--- a/libc/test/src/math/FAbsTest.h
+++ b/libc/test/src/math/FAbsTest.h
@@ -37,7 +37,7 @@ class FAbsTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(FabsFunc func) {
- constexpr StorageType COUNT = 100'000;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
T x = FPBits(v).get_val();
diff --git a/libc/test/src/math/FDimTest.h b/libc/test/src/math/FDimTest.h
index 03ff26ab23798..72063b0234bb1 100644
--- a/libc/test/src/math/FDimTest.h
+++ b/libc/test/src/math/FDimTest.h
@@ -64,7 +64,7 @@ class FDimTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
void test_in_range(FuncPtr func) {
constexpr StorageType STORAGE_MAX =
LIBC_NAMESPACE::cpp::numeric_limits<StorageType>::max();
- constexpr StorageType COUNT = 100'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0, w = STORAGE_MAX; i <= COUNT;
++i, v += STEP, w -= STEP) {
diff --git a/libc/test/src/math/FMaxTest.h b/libc/test/src/math/FMaxTest.h
index 772409062ef5a..3f62dffa16b93 100644
--- a/libc/test/src/math/FMaxTest.h
+++ b/libc/test/src/math/FMaxTest.h
@@ -60,7 +60,7 @@ class FMaxTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(FMaxFunc func) {
- constexpr StorageType COUNT = 100'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0, w = STORAGE_MAX; i <= COUNT;
++i, v += STEP, w -= STEP) {
diff --git a/libc/test/src/math/FMinTest.h b/libc/test/src/math/FMinTest.h
index 3822d7cb73785..d4bf26906c231 100644
--- a/libc/test/src/math/FMinTest.h
+++ b/libc/test/src/math/FMinTest.h
@@ -61,7 +61,7 @@ class FMinTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(FMinFunc func) {
- constexpr StorageType COUNT = 100'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0, w = STORAGE_MAX; i <= COUNT;
++i, v += STEP, w -= STEP) {
diff --git a/libc/test/src/math/FloorTest.h b/libc/test/src/math/FloorTest.h
index cce0c731ebbc0..0ac31c0306cfa 100644
--- a/libc/test/src/math/FloorTest.h
+++ b/libc/test/src/math/FloorTest.h
@@ -70,7 +70,7 @@ class FloorTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(FloorFunc func) {
- constexpr int COUNT = 100'000;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>(STORAGE_MAX / COUNT), StorageType(1));
StorageType v = 0;
diff --git a/libc/test/src/math/FmaTest.h b/libc/test/src/math/FmaTest.h
index 902ff0413b0fa..c1e0fab482026 100644
--- a/libc/test/src/math/FmaTest.h
+++ b/libc/test/src/math/FmaTest.h
@@ -58,7 +58,7 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using FmaFunc = OutType (*)(InType, InType, InType);
void test_subnormal_range(FmaFunc func) {
- constexpr InStorageType COUNT = 10'001;
+ constexpr InStorageType COUNT = 1'231;
constexpr InStorageType RAW_STEP =
(IN_MAX_SUBNORMAL_U - IN_MIN_SUBNORMAL_U) / COUNT;
constexpr InStorageType STEP = (RAW_STEP == 0 ? 1 : RAW_STEP);
@@ -76,7 +76,7 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(FmaFunc func) {
- constexpr InStorageType COUNT = 10'001;
+ constexpr InStorageType COUNT = 1'231;
constexpr InStorageType RAW_STEP =
(IN_MAX_NORMAL_U - IN_MIN_NORMAL_U) / COUNT;
constexpr InStorageType STEP = (RAW_STEP == 0 ? 1 : RAW_STEP);
diff --git a/libc/test/src/math/FrexpTest.h b/libc/test/src/math/FrexpTest.h
index d1151c83efbd3..36207b54dda86 100644
--- a/libc/test/src/math/FrexpTest.h
+++ b/libc/test/src/math/FrexpTest.h
@@ -95,7 +95,7 @@ class FrexpTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
void testRange(FrexpFunc func) {
using StorageType = typename FPBits::StorageType;
- constexpr StorageType COUNT = 100'000;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
T x = FPBits(v).get_val();
diff --git a/libc/test/src/math/HypotTest.h b/libc/test/src/math/HypotTest.h
index b37abf7e156d3..146f85d0b3601 100644
--- a/libc/test/src/math/HypotTest.h
+++ b/libc/test/src/math/HypotTest.h
@@ -70,7 +70,7 @@ class HypotTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_subnormal_range(Func func) {
- constexpr StorageType COUNT = 10'001;
+ constexpr StorageType COUNT = 1'231;
constexpr unsigned SCALE = (sizeof(T) < 4) ? 1 : 4;
for (unsigned scale = 0; scale < SCALE; ++scale) {
StorageType max_value = static_cast<StorageType>(MAX_SUBNORMAL << scale);
@@ -95,7 +95,7 @@ class HypotTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(Func func) {
- constexpr StorageType COUNT = 10'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = (MAX_NORMAL - MIN_NORMAL) / COUNT;
for (int signs = 0; signs < 4; ++signs) {
for (StorageType v = MIN_NORMAL, w = MAX_NORMAL;
diff --git a/libc/test/src/math/ILogbTest.h b/libc/test/src/math/ILogbTest.h
index 5d805ef7a1e22..3357ef4df73d5 100644
--- a/libc/test/src/math/ILogbTest.h
+++ b/libc/test/src/math/ILogbTest.h
@@ -80,7 +80,7 @@ class LlvmLibcILogbTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using StorageType = typename FPBits::StorageType;
constexpr StorageType MIN_SUBNORMAL = FPBits::min_subnormal().uintval();
constexpr StorageType MAX_SUBNORMAL = FPBits::max_subnormal().uintval();
- constexpr StorageType COUNT = 10'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = (MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT;
for (StorageType v = MIN_SUBNORMAL; v <= MAX_SUBNORMAL; v += STEP) {
T x = FPBits(v).get_val();
@@ -99,7 +99,7 @@ class LlvmLibcILogbTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using StorageType = typename FPBits::StorageType;
constexpr StorageType MIN_NORMAL = FPBits::min_normal().uintval();
constexpr StorageType MAX_NORMAL = FPBits::max_normal().uintval();
- constexpr StorageType COUNT = 10'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = (MAX_NORMAL - MIN_NORMAL) / COUNT;
for (StorageType v = MIN_NORMAL; v <= MAX_NORMAL; v += STEP) {
T x = FPBits(v).get_val();
diff --git a/libc/test/src/math/LogbTest.h b/libc/test/src/math/LogbTest.h
index 5ef3b2675a49e..83ac99b7d4ebd 100644
--- a/libc/test/src/math/LogbTest.h
+++ b/libc/test/src/math/LogbTest.h
@@ -74,7 +74,7 @@ class LogbTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
void testRange(LogbFunc func) {
using StorageType = typename FPBits::StorageType;
- constexpr StorageType COUNT = 100'000;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
T x = FPBits(v).get_val();
diff --git a/libc/test/src/math/ModfTest.h b/libc/test/src/math/ModfTest.h
index 3377290169610..a6def094c07eb 100644
--- a/libc/test/src/math/ModfTest.h
+++ b/libc/test/src/math/ModfTest.h
@@ -86,7 +86,7 @@ class ModfTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(ModfFunc func) {
- constexpr StorageType COUNT = 100'000;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
T x = FPBits(v).get_val();
diff --git a/libc/test/src/math/MulTest.h b/libc/test/src/math/MulTest.h
index cb81a795be36b..5f74087a6bc5c 100644
--- a/libc/test/src/math/MulTest.h
+++ b/libc/test/src/math/MulTest.h
@@ -48,7 +48,7 @@ class MulTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using MulFunc = OutType (*)(InType, InType);
void test_subnormal_range(MulFunc func) {
- constexpr InStorageType COUNT = 10'001;
+ constexpr InStorageType COUNT = 1'231;
constexpr InStorageType STEP =
(IN_MAX_SUBNORMAL_U - IN_MIN_SUBNORMAL_U) / COUNT;
LIBC_NAMESPACE::srand(1);
@@ -68,7 +68,7 @@ class MulTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(MulFunc func) {
- constexpr InStorageType COUNT = 10'001;
+ constexpr InStorageType COUNT = 1'231;
constexpr InStorageType STEP = (IN_MAX_NORMAL_U - IN_MIN_NORMAL_U) / COUNT;
LIBC_NAMESPACE::srand(1);
for (int signs = 0; signs < 4; signs++) {
diff --git a/libc/test/src/math/NearbyIntTest.h b/libc/test/src/math/NearbyIntTest.h
index 88cdf453f0556..6e79f318a194d 100644
--- a/libc/test/src/math/NearbyIntTest.h
+++ b/libc/test/src/math/NearbyIntTest.h
@@ -70,7 +70,7 @@ class NearbyIntTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_subnormal_range(NearbyIntFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
const StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT),
StorageType(1));
@@ -85,7 +85,7 @@ class NearbyIntTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(NearbyIntFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
const StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_NORMAL - MIN_NORMAL) / COUNT),
StorageType(1));
diff --git a/libc/test/src/math/RIntTest.h b/libc/test/src/math/RIntTest.h
index 86e73bb5b0548..0ee7690c8f46b 100644
--- a/libc/test/src/math/RIntTest.h
+++ b/libc/test/src/math/RIntTest.h
@@ -104,7 +104,7 @@ class RIntTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testSubnormalRange(RIntFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT),
StorageType(1));
@@ -119,7 +119,7 @@ class RIntTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testNormalRange(RIntFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_NORMAL - MIN_NORMAL) / COUNT),
StorageType(1));
diff --git a/libc/test/src/math/RemQuoTest.h b/libc/test/src/math/RemQuoTest.h
index e664000fd18d1..40b4ce748fa6b 100644
--- a/libc/test/src/math/RemQuoTest.h
+++ b/libc/test/src/math/RemQuoTest.h
@@ -104,7 +104,7 @@ class RemQuoTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testSubnormalRange(RemQuoFunc func) {
- constexpr StorageType COUNT = 100'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = (MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT;
for (StorageType v = MIN_SUBNORMAL, w = MAX_SUBNORMAL;
v <= MAX_SUBNORMAL && w >= MIN_SUBNORMAL; v += STEP, w -= STEP) {
@@ -117,7 +117,7 @@ class RemQuoTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testNormalRange(RemQuoFunc func) {
- constexpr StorageType COUNT = 1'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = (MAX_NORMAL - MIN_NORMAL) / COUNT;
for (StorageType v = MIN_NORMAL, w = MAX_NORMAL;
v <= MAX_NORMAL && w >= MIN_NORMAL; v += STEP, w -= STEP) {
diff --git a/libc/test/src/math/RoundEvenTest.h b/libc/test/src/math/RoundEvenTest.h
index 5ecda66ccb588..761c258fc5573 100644
--- a/libc/test/src/math/RoundEvenTest.h
+++ b/libc/test/src/math/RoundEvenTest.h
@@ -72,7 +72,7 @@ class RoundEvenTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(RoundEvenFunc func) {
- constexpr int COUNT = 100'000;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>(STORAGE_MAX / COUNT), StorageType(1));
StorageType v = 0;
diff --git a/libc/test/src/math/RoundTest.h b/libc/test/src/math/RoundTest.h
index d571d5d8feed4..a32b24a7a7719 100644
--- a/libc/test/src/math/RoundTest.h
+++ b/libc/test/src/math/RoundTest.h
@@ -70,7 +70,7 @@ class RoundTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(RoundFunc func) {
- constexpr int COUNT = 100'000;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>(STORAGE_MAX / COUNT), StorageType(1));
StorageType v = 0;
diff --git a/libc/test/src/math/RoundToIntegerTest.h b/libc/test/src/math/RoundToIntegerTest.h
index 469db111302c2..1795b85576649 100644
--- a/libc/test/src/math/RoundToIntegerTest.h
+++ b/libc/test/src/math/RoundToIntegerTest.h
@@ -240,7 +240,7 @@ class RoundToIntegerTestTemplate
}
void testSubnormalRange(RoundToIntegerFunc func) {
- constexpr int COUNT = 1'000'001;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_SUBNORMAL - MIN_SUBNORMAL) / COUNT),
StorageType(1));
@@ -284,7 +284,7 @@ class RoundToIntegerTestTemplate
if (sizeof(IntType) > sizeof(long))
return;
- constexpr int COUNT = 1'000'001;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<StorageType>((MAX_NORMAL - MIN_NORMAL) / COUNT),
StorageType(1));
diff --git a/libc/test/src/math/RsqrtTest.h b/libc/test/src/math/RsqrtTest.h
index d11d708f644d9..253cacd7d2cec 100644
--- a/libc/test/src/math/RsqrtTest.h
+++ b/libc/test/src/math/RsqrtTest.h
@@ -39,7 +39,7 @@ class RsqrtTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
// Even sampling across all subnormals.
- constexpr StorageType COUNT = 200'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = HIDDEN_BIT / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
InType x = FPBits(i).get_val();
@@ -49,7 +49,7 @@ class RsqrtTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
// Positive normal range sampling: skip NaNs and negative values.
void test_normal_range(RsqrtFunc func) {
- constexpr StorageType COUNT = 200'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
FPBits x_bits(v);
diff --git a/libc/test/src/math/SqrtTest.h b/libc/test/src/math/SqrtTest.h
index fdfc4f9bb9943..d59f5309a085c 100644
--- a/libc/test/src/math/SqrtTest.h
+++ b/libc/test/src/math/SqrtTest.h
@@ -32,7 +32,7 @@ class SqrtTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
ASSERT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Sqrt, x, func(x), 0.5);
}
- constexpr StorageType COUNT = 200'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = HIDDEN_BIT / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
InType x = FPBits(i).get_val();
@@ -41,7 +41,7 @@ class SqrtTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(SqrtFunc func) {
- constexpr StorageType COUNT = 200'001;
+ constexpr StorageType COUNT = 1'231;
constexpr StorageType STEP = STORAGE_MAX / COUNT;
for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
FPBits x_bits(v);
diff --git a/libc/test/src/math/SubTest.h b/libc/test/src/math/SubTest.h
index b799d78515fa4..6cf3e7ba751ef 100644
--- a/libc/test/src/math/SubTest.h
+++ b/libc/test/src/math/SubTest.h
@@ -40,7 +40,7 @@ class SubTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
using SubFunc = OutType (*)(InType, InType);
void test_subnormal_range(SubFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
constexpr InStorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<InStorageType>((IN_MAX_SUBNORMAL_U - IN_MIN_SUBNORMAL_U) /
COUNT),
@@ -57,7 +57,7 @@ class SubTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void test_normal_range(SubFunc func) {
- constexpr int COUNT = 100'001;
+ constexpr int COUNT = 1'231;
constexpr InStorageType STEP = LIBC_NAMESPACE::cpp::max(
static_cast<InStorageType>((IN_MAX_NORMAL_U - IN_MIN_NORMAL_U) / COUNT),
InStorageType(1));
diff --git a/libc/test/src/math/TruncTest.h b/libc/test/src/math/TruncTest.h
index 76c9740a917bf..db0f19c83265f 100644
--- a/libc/test/src/math/TruncTest.h
+++ b/libc/test/src/math/TruncTest.h
@@ -70,7 +70,7 @@ class TruncTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
}
void testRange(TruncFunc func) {
- constexpr int COUNT = 100'000;
+ constexpr int COUNT = 1'231;
constexpr StorageType STEP = LIBC_NAMESPACE::cpp::max...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/199308
More information about the libc-commits
mailing list