P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

Programming / Compilers / GCC - redi [138bc75d-0d04-0410-961f-82ee72b054a4] - 3 July 2018 21:04 EDT

P0553R2 is not in the C++2a working draft yet, but is likely to be approved soon. Neither proposal supports std::byte but this adds overloads of each function for std::byte, assuming that will also get added.

- include/Makefile.am: Add new header.
- include/Makefile.in: Regenerate.
- include/precompiled/stdc++.h: Include new header.
- include/std/bit: New header. (__rotl, __rotr, __countl_zero, __countl_one, __countr_zero) (__countr_one, __popcount, __ispow2, __ceil2, __floor2, __log2p1): Define for C++14. [!__STRICT_ANSI__] (rotl, rotr, countl_zero, countl_one, countr_zero) (countr_one, popcount): Define for C++2a. Also overload for std::byte. (ispow2, ceil2, floor2, log2p1): Define for C++2a. [!__STRICT_ANSI__] (ispow2, ceil2, floor2, log2p1): Overload for std::byte.
- testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: New.
- testsuite/26_numerics/bit/bit.pow.two/floor2.cc: New.
- testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: New.
- testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: New.
- testsuite/26_numerics/bit/bitops.rot/rotl.cc: New.
- testsuite/26_numerics/bit/bitops.rot/rotr.cc: New.
- testsuite/26_numerics/bit/bitops.count/countl_one.cc: New.
- testsuite/26_numerics/bit/bitops.count/countl_zero.cc: New.
- testsuite/26_numerics/bit/bitops.count/countr_one.cc: New.
- testsuite/26_numerics/bit/bitops.count/countr_zero.cc: New.

927fb59733e P0556R3 Integral power-of-2 operations, P0553R2 Bit operations
libstdc++-v3/ChangeLog | 24 ++
libstdc++-v3/include/Makefile.am | 1 +
libstdc++-v3/include/Makefile.in | 1 +
libstdc++-v3/include/precompiled/stdc++.h | 1 +
libstdc++-v3/include/std/bit | 359 +++++++++++++++++++++
.../testsuite/26_numerics/bit/bit.pow.two/ceil2.cc | 108 +++++++
.../26_numerics/bit/bit.pow.two/floor2.cc | 109 +++++++
.../26_numerics/bit/bit.pow.two/ispow2.cc | 157 +++++++++
.../26_numerics/bit/bit.pow.two/log2p1.cc | 109 +++++++
.../26_numerics/bit/bitops.count/countl_one.cc | 103 ++++++
.../26_numerics/bit/bitops.count/countl_zero.cc | 104 ++++++
.../26_numerics/bit/bitops.count/countr_one.cc | 106 ++++++
.../26_numerics/bit/bitops.count/countr_zero.cc | 105 ++++++
.../testsuite/26_numerics/bit/bitops.rot/rotl.cc | 119 +++++++
.../testsuite/26_numerics/bit/bitops.rot/rotr.cc | 119 +++++++
15 files changed, 1525 insertions(+)

Upstream: gcc.gnu.org


  • Share