mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
This moves the __detail::_Select_uint_least_t<N>::type class to namespace scope and extends it with more 128-bit arithmetic operations, implemented in terms of uint64_t. Now std::philox_engine can use _Select_uint_least_t<w*2>::type instead of __uint128_t, so that it works on targets without 128-bit integers. This also means that targets that do support __uint128_t only use it when actually necessary, so that we use uint64_t when generating a 32-bit result (e.g. with std::philox4x32). libstdc++-v3/ChangeLog: * include/bits/random.h [!__SIZEOF_INT128__] (__rand_uint128): Refactor and rename _Select_uint_least_t<128>::type to a new class. Make all members constexpr. Add new member functions for additional arithmetic and bitwise operations, and comparisons. (__detail::_Select_uint_least_t<>::type): Define as an alias of __rand_uint128. * include/bits/random.tcc (philox_engine::_M_mulhi): Use _Select_uint_least_t<w*2>::type instead of __uint128_t. (philox_engine::_M_transition): Likewise. * include/bits/version.def (philox_engine): Remove extra_cond. * include/bits/version.h: Regenerate. * testsuite/26_numerics/random/philox4x32.cc: Remove dg-require-cpp-feature-test directive. * testsuite/26_numerics/random/philox4x64.cc: Likewise. * testsuite/26_numerics/random/philox_engine/cons/copy.cc: Likewise. * testsuite/26_numerics/random/philox_engine/cons/default.cc: Likewise. * testsuite/26_numerics/random/philox_engine/cons/seed.cc: Likewise. * testsuite/26_numerics/random/philox_engine/operators/equal.cc: Likewise. * testsuite/26_numerics/random/philox_engine/operators/serialize.cc: Likewise. * testsuite/26_numerics/random/philox_engine/requirements/constants.cc: Likewise. * testsuite/26_numerics/random/philox_engine/requirements/typedefs.cc: Likewise. Co-authored-by: Jakub Jelinek <jakub@redhat.com> Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.