P0556R3 Integral power-of-2 operations, P0553R2 Bit operations
authorJonathan Wakely <jwakely@redhat.com>
Tue, 3 Jul 2018 21:04:45 +0000 (22:04 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 3 Jul 2018 21:04:45 +0000 (22:04 +0100)
commitf3e91052bd7e5af791ca720cd14e9ac9227e3801
tree93c8036d608b1b66477816d43343955cc80e6940
parentcf3e6e9f15e11273083517ebfd7d0a94213d70f5
P0556R3 Integral power-of-2 operations, P0553R2 Bit operations

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.

From-SVN: r262360
15 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/precompiled/stdc++.h
libstdc++-v3/include/std/bit [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/floor2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ispow2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/log2p1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_one.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countl_zero.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_one.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.count/countr_zero.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotl.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/bit/bitops.rot/rotr.cc [new file with mode: 0644]