-
- Downloads
libstdc++: Use 128-bit arithmetic for std::linear_congruential_engine [PR87744]
For 32-bit targets without __int128 we need to implement the LCG transition function by hand using 64-bit types. We can also slightly simplify the __mod function by using if-constexpr unconditionally, disabling -Wc++17-extensions warnings with diagnostic pragmas. libstdc++-v3/ChangeLog: PR libstdc++/87744 * include/bits/random.h [!__SIZEOF_INT128__] (_Select_uint_least_t): Define specialization for 64-bit generators with non-power-of-two modulus and large constants. (__mod): Use if constexpr unconditionally. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line number. * testsuite/26_numerics/random/linear_congruential_engine/87744.cc: New test.
Showing
- libstdc++-v3/include/bits/random.h 109 additions, 7 deletionslibstdc++-v3/include/bits/random.h
- libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/87744.cc 22 additions, 0 deletions...te/26_numerics/random/linear_congruential_engine/87744.cc
- libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc 1 addition, 1 deletionlibstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc
Loading
Please register or sign in to comment