diff --git a/libc/test/src/math/CeilTest.h b/libc/test/src/math/CeilTest.h --- a/libc/test/src/math/CeilTest.h +++ b/libc/test/src/math/CeilTest.h @@ -64,7 +64,7 @@ } void testRange(CeilFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/CopySignTest.h b/libc/test/src/math/CopySignTest.h --- a/libc/test/src/math/CopySignTest.h +++ b/libc/test/src/math/CopySignTest.h @@ -33,7 +33,7 @@ } void testRange(CopySignFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/FAbsTest.h b/libc/test/src/math/FAbsTest.h --- a/libc/test/src/math/FAbsTest.h +++ b/libc/test/src/math/FAbsTest.h @@ -32,7 +32,7 @@ } void testRange(FabsFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/FDimTest.h b/libc/test/src/math/FDimTest.h --- a/libc/test/src/math/FDimTest.h +++ b/libc/test/src/math/FDimTest.h @@ -53,7 +53,7 @@ } void test_in_range(FuncPtr func) { - constexpr UIntType COUNT = 10000001; + constexpr UIntType COUNT = 100'001; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT; ++i, v += STEP, w -= STEP) { diff --git a/libc/test/src/math/FMaxTest.h b/libc/test/src/math/FMaxTest.h --- a/libc/test/src/math/FMaxTest.h +++ b/libc/test/src/math/FMaxTest.h @@ -55,7 +55,7 @@ } void testRange(FMaxFunc func) { - constexpr UIntType COUNT = 10000001; + constexpr UIntType COUNT = 100'001; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT; ++i, v += STEP, w -= STEP) { diff --git a/libc/test/src/math/FMinTest.h b/libc/test/src/math/FMinTest.h --- a/libc/test/src/math/FMinTest.h +++ b/libc/test/src/math/FMinTest.h @@ -55,7 +55,7 @@ } void testRange(FMinFunc func) { - constexpr UIntType COUNT = 10000001; + constexpr UIntType COUNT = 100'001; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT; ++i, v += STEP, w -= STEP) { diff --git a/libc/test/src/math/FloorTest.h b/libc/test/src/math/FloorTest.h --- a/libc/test/src/math/FloorTest.h +++ b/libc/test/src/math/FloorTest.h @@ -64,7 +64,7 @@ } void testRange(FloorFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/FrexpTest.h b/libc/test/src/math/FrexpTest.h --- a/libc/test/src/math/FrexpTest.h +++ b/libc/test/src/math/FrexpTest.h @@ -93,7 +93,7 @@ void testRange(FrexpFunc func) { using UIntType = typename FPBits::UIntType; - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = static_cast(FPBits(v)); diff --git a/libc/test/src/math/ILogbTest.h b/libc/test/src/math/ILogbTest.h --- a/libc/test/src/math/ILogbTest.h +++ b/libc/test/src/math/ILogbTest.h @@ -18,7 +18,9 @@ class LlvmLibcILogbTest : public __llvm_libc::testing::Test { public: - template struct ILogbFunc { typedef int (*Func)(T); }; + template struct ILogbFunc { + typedef int (*Func)(T); + }; template void test_special_numbers(typename ILogbFunc::Func func) { @@ -75,7 +77,7 @@ void test_subnormal_range(typename ILogbFunc::Func func) { using FPBits = __llvm_libc::fputil::FPBits; using UIntType = typename FPBits::UIntType; - constexpr UIntType COUNT = 1000001; + constexpr UIntType COUNT = 10'001; constexpr UIntType STEP = (FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT; for (UIntType v = FPBits::MIN_SUBNORMAL; v <= FPBits::MAX_SUBNORMAL; @@ -94,7 +96,7 @@ void test_normal_range(typename ILogbFunc::Func func) { using FPBits = __llvm_libc::fputil::FPBits; using UIntType = typename FPBits::UIntType; - constexpr UIntType COUNT = 1000001; + constexpr UIntType COUNT = 10'001; constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT; for (UIntType v = FPBits::MIN_NORMAL; v <= FPBits::MAX_NORMAL; v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/LogbTest.h b/libc/test/src/math/LogbTest.h --- a/libc/test/src/math/LogbTest.h +++ b/libc/test/src/math/LogbTest.h @@ -72,7 +72,7 @@ void testRange(LogbFunc func) { using UIntType = typename FPBits::UIntType; - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = static_cast(FPBits(v)); diff --git a/libc/test/src/math/ModfTest.h b/libc/test/src/math/ModfTest.h --- a/libc/test/src/math/ModfTest.h +++ b/libc/test/src/math/ModfTest.h @@ -84,7 +84,7 @@ } void testRange(ModfFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/RoundTest.h b/libc/test/src/math/RoundTest.h --- a/libc/test/src/math/RoundTest.h +++ b/libc/test/src/math/RoundTest.h @@ -64,7 +64,7 @@ } void testRange(RoundFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/TruncTest.h b/libc/test/src/math/TruncTest.h --- a/libc/test/src/math/TruncTest.h +++ b/libc/test/src/math/TruncTest.h @@ -64,7 +64,7 @@ } void testRange(TruncFunc func) { - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { T x = T(FPBits(v)); diff --git a/libc/test/src/math/acosf_test.cpp b/libc/test/src/math/acosf_test.cpp --- a/libc/test/src/math/acosf_test.cpp +++ b/libc/test/src/math/acosf_test.cpp @@ -37,7 +37,7 @@ } TEST(LlvmLibcAcosfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/acoshf_test.cpp b/libc/test/src/math/acoshf_test.cpp --- a/libc/test/src/math/acoshf_test.cpp +++ b/libc/test/src/math/acoshf_test.cpp @@ -43,7 +43,7 @@ } TEST(LlvmLibcAcoshfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits_t(v)); diff --git a/libc/test/src/math/asinf_test.cpp b/libc/test/src/math/asinf_test.cpp --- a/libc/test/src/math/asinf_test.cpp +++ b/libc/test/src/math/asinf_test.cpp @@ -44,7 +44,7 @@ } TEST(LlvmLibcAsinfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/atanf_test.cpp b/libc/test/src/math/atanf_test.cpp --- a/libc/test/src/math/atanf_test.cpp +++ b/libc/test/src/math/atanf_test.cpp @@ -44,7 +44,7 @@ } TEST(LlvmLibcAtanfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; const uint32_t STEP = FPBits(inf).uintval() / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/atanhf_test.cpp b/libc/test/src/math/atanhf_test.cpp --- a/libc/test/src/math/atanhf_test.cpp +++ b/libc/test/src/math/atanhf_test.cpp @@ -86,7 +86,7 @@ } TEST(LlvmLibcAtanhfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; const uint32_t STEP = FPBits(1.0f).uintval() / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/cos_test.cpp b/libc/test/src/math/cos_test.cpp --- a/libc/test/src/math/cos_test.cpp +++ b/libc/test/src/math/cos_test.cpp @@ -19,7 +19,7 @@ TEST(LlvmLibccosTest, Range) { static constexpr double _2pi = 6.283185307179586; - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { double x = double(FPBits(v)); diff --git a/libc/test/src/math/cosf_test.cpp b/libc/test/src/math/cosf_test.cpp --- a/libc/test/src/math/cosf_test.cpp +++ b/libc/test/src/math/cosf_test.cpp @@ -45,7 +45,7 @@ } TEST(LlvmLibcCosfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/coshf_test.cpp b/libc/test/src/math/coshf_test.cpp --- a/libc/test/src/math/coshf_test.cpp +++ b/libc/test/src/math/coshf_test.cpp @@ -59,7 +59,7 @@ } TEST(LlvmLibcCoshfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/exp10f_test.cpp b/libc/test/src/math/exp10f_test.cpp --- a/libc/test/src/math/exp10f_test.cpp +++ b/libc/test/src/math/exp10f_test.cpp @@ -106,7 +106,7 @@ } TEST(LlvmLibcExp10fTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/exp2f_test.cpp b/libc/test/src/math/exp2f_test.cpp --- a/libc/test/src/math/exp2f_test.cpp +++ b/libc/test/src/math/exp2f_test.cpp @@ -103,7 +103,7 @@ } TEST(LlvmLibcExp2fTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/expf_test.cpp b/libc/test/src/math/expf_test.cpp --- a/libc/test/src/math/expf_test.cpp +++ b/libc/test/src/math/expf_test.cpp @@ -104,7 +104,7 @@ } TEST(LlvmLibcExpfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/expm1f_test.cpp b/libc/test/src/math/expm1f_test.cpp --- a/libc/test/src/math/expm1f_test.cpp +++ b/libc/test/src/math/expm1f_test.cpp @@ -113,7 +113,7 @@ } TEST(LlvmLibcExpm1fTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/log10f_test.cpp b/libc/test/src/math/log10f_test.cpp --- a/libc/test/src/math/log10f_test.cpp +++ b/libc/test/src/math/log10f_test.cpp @@ -65,7 +65,7 @@ } TEST(LlvmLibcLog10fTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/log1pf_test.cpp b/libc/test/src/math/log1pf_test.cpp --- a/libc/test/src/math/log1pf_test.cpp +++ b/libc/test/src/math/log1pf_test.cpp @@ -70,7 +70,7 @@ } TEST(LlvmLibclog1pfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/log2f_test.cpp b/libc/test/src/math/log2f_test.cpp --- a/libc/test/src/math/log2f_test.cpp +++ b/libc/test/src/math/log2f_test.cpp @@ -44,7 +44,7 @@ } TEST(LlvmLibcLog2fTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/logf_test.cpp b/libc/test/src/math/logf_test.cpp --- a/libc/test/src/math/logf_test.cpp +++ b/libc/test/src/math/logf_test.cpp @@ -76,7 +76,7 @@ } TEST(LlvmLibcLogfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/sin_test.cpp b/libc/test/src/math/sin_test.cpp --- a/libc/test/src/math/sin_test.cpp +++ b/libc/test/src/math/sin_test.cpp @@ -20,7 +20,7 @@ TEST(LlvmLibcSinTest, Range) { static constexpr double _2pi = 6.283185307179586; - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { double x = double(FPBits(v)); diff --git a/libc/test/src/math/sinf_test.cpp b/libc/test/src/math/sinf_test.cpp --- a/libc/test/src/math/sinf_test.cpp +++ b/libc/test/src/math/sinf_test.cpp @@ -45,7 +45,7 @@ } TEST(LlvmLibcSinfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/sinhf_test.cpp b/libc/test/src/math/sinhf_test.cpp --- a/libc/test/src/math/sinhf_test.cpp +++ b/libc/test/src/math/sinhf_test.cpp @@ -44,7 +44,7 @@ } TEST(LlvmLibcSinhfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/tan_test.cpp b/libc/test/src/math/tan_test.cpp --- a/libc/test/src/math/tan_test.cpp +++ b/libc/test/src/math/tan_test.cpp @@ -19,7 +19,7 @@ TEST(LlvmLibctanTest, Range) { static constexpr double _2pi = 6.283185307179586; - constexpr UIntType COUNT = 10000000; + constexpr UIntType COUNT = 100'000; constexpr UIntType STEP = UIntType(-1) / COUNT; for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { double x = double(FPBits(v)); diff --git a/libc/test/src/math/tanf_test.cpp b/libc/test/src/math/tanf_test.cpp --- a/libc/test/src/math/tanf_test.cpp +++ b/libc/test/src/math/tanf_test.cpp @@ -45,7 +45,7 @@ } TEST(LlvmLibcTanfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/src/math/tanhf_test.cpp b/libc/test/src/math/tanhf_test.cpp --- a/libc/test/src/math/tanhf_test.cpp +++ b/libc/test/src/math/tanhf_test.cpp @@ -43,7 +43,7 @@ } TEST(LlvmLibcTanhfTest, InFloatRange) { - constexpr uint32_t COUNT = 1000000; + constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { float x = float(FPBits(v)); diff --git a/libc/test/utils/FPUtil/x86_long_double_test.cpp b/libc/test/utils/FPUtil/x86_long_double_test.cpp --- a/libc/test/utils/FPUtil/x86_long_double_test.cpp +++ b/libc/test/utils/FPUtil/x86_long_double_test.cpp @@ -19,10 +19,11 @@ // builtin function. Hence, matching LLVM-libc's notion of NaN with the // isnan result ensures that LLVM-libc's behavior matches the compiler's // behavior. + constexpr uint32_t COUNT = 100'000; FPBits bits(0.0l); bits.set_unbiased_exponent(FPBits::MAX_EXPONENT); - for (unsigned int i = 0; i < 1000000; ++i) { + for (unsigned int i = 0; i < COUNT; ++i) { // If exponent has the max value and the implicit bit is 0, // then the number is a NaN for all values of mantissa. bits.set_mantissa(i); @@ -32,7 +33,7 @@ } bits.set_implicit_bit(1); - for (unsigned int i = 1; i < 1000000; ++i) { + for (unsigned int i = 1; i < COUNT; ++i) { // If exponent has the max value and the implicit bit is 1, // then the number is a NaN for all non-zero values of mantissa. // Note the initial value of |i| of 1 to avoid a zero mantissa. @@ -44,7 +45,7 @@ bits.set_unbiased_exponent(1); bits.set_implicit_bit(0); - for (unsigned int i = 0; i < 1000000; ++i) { + for (unsigned int i = 0; i < COUNT; ++i) { // If exponent is non-zero and also not max, and the implicit bit is 0, // then the number is a NaN for all values of mantissa. bits.set_mantissa(i); @@ -55,7 +56,7 @@ bits.set_unbiased_exponent(1); bits.set_implicit_bit(1); - for (unsigned int i = 0; i < 1000000; ++i) { + for (unsigned int i = 0; i < COUNT; ++i) { // If exponent is non-zero and also not max, and the implicit bit is 1, // then the number is normal value for all values of mantissa. bits.set_mantissa(i); @@ -66,7 +67,7 @@ bits.set_unbiased_exponent(0); bits.set_implicit_bit(1); - for (unsigned int i = 0; i < 1000000; ++i) { + for (unsigned int i = 0; i < COUNT; ++i) { // If exponent is zero, then the number is a valid but denormal value. bits.set_mantissa(i); long double valid = bits; @@ -76,7 +77,7 @@ bits.set_unbiased_exponent(0); bits.set_implicit_bit(0); - for (unsigned int i = 0; i < 1000000; ++i) { + for (unsigned int i = 0; i < COUNT; ++i) { // If exponent is zero, then the number is a valid but denormal value. bits.set_mantissa(i); long double valid = bits;