From: Tomasz KamiƄski Date: Tue, 21 Jul 2026 11:25:13 +0000 (+0200) Subject: libstdc++: Handle ibm128 in generate_canonical tests. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef6451b6aec387c5693719fe048c4f11a6be2edb;p=thirdparty%2Fgcc.git libstdc++: Handle ibm128 in generate_canonical tests. Numeric traits for ibm128 (double-double) reports is_iec559 as true, and thus was hitting VERIFY(false) default branch. libstdc++-v3/ChangeLog: * testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc: Remove trailing whitespace. Handle 106 (ibm128) mantissa size. --- diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc index ae93ec13b7a..1161d5603c2 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc @@ -16,7 +16,7 @@ struct local_rng : std::mt19937 static constexpr std::uint64_t max() { return max_val; } std::uint64_t operator()() { return std::mt19937::operator()() % (max() + 1); } - + local_rng(std::mt19937 const& arg) : std::mt19937(arg) {} }; @@ -30,7 +30,7 @@ int ifloor(__float128 t) #endif // Verify P0952R2 implementation requiring a second round-trip -// if first yields exactly 1. +// if first yields exactly 1. template @@ -106,12 +106,13 @@ test_2p32(const std::mt19937& rng) VERIFY(zeros == 0); break; case 53: // ieee64 - case 64: // ieee80 + case 64: // ieee80 VERIFY(deviation == 7650); VERIFY(max == 259); VERIFY(rms == 975); VERIFY(zeros == 0); break; + case 106: // ibm128 case 113: // ieee128 VERIFY(deviation == 9086); VERIFY(max == 290); @@ -159,13 +160,20 @@ test_10p6(const std::mt19937& rng) VERIFY(rms == 921); VERIFY(zeros == 0); break; - case 64: // ieee80 + case 64: // ieee80 VERIFY(skips == 1); VERIFY(deviation == 7774); VERIFY(max == 250); VERIFY(rms == 958); VERIFY(zeros == 0); break; + case 106: // ibm128 + VERIFY(skips == 96); + VERIFY(deviation == 6980); + VERIFY(max == 260); + VERIFY(rms == 876); + VERIFY(zeros == 0); + break; case 113: // ieee128 VERIFY(skips == 3074); VERIFY(deviation == 7568); @@ -214,13 +222,20 @@ test_2p31m1(const std::mt19937& rng) VERIFY(rms == 937); VERIFY(zeros == 0); break; - case 64: // ieee80 + case 64: // ieee80 VERIFY(skips == 143342); VERIFY(deviation == 7788); VERIFY(max == 296); VERIFY(rms == 977); VERIFY(zeros == 0); break; + case 106: // ibm128 + VERIFY(skips == 0); + VERIFY(deviation == 8828); + VERIFY(max == 330); + VERIFY(rms == 1084); + VERIFY(zeros == 0); + break; case 113: // ieee128 VERIFY(skips == 8); VERIFY(deviation == 8824); @@ -240,7 +255,7 @@ int main() std::seed_seq sequence{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; rng.seed(sequence); rng.discard(12 * 629143); - + test_2p32(rng); test_10p6(rng); test_2p31m1(rng);