libstdc++ patch ping (Re: [PATCH] libstdc++, v2: Implement C++29 P3104R6 - Bit permutations)

Jakub Jelinek jakub@redhat.com
Mon Oct 12 09:10:46 GMT 2026


Hi!

On Sat, Sep 19, 2026 at 08:44:03PM +0200, Jakub Jelinek wrote:
> On Fri, Sep 18, 2026 at 07:46:06PM +0200, Jakub Jelinek wrote:
> > The following patch implements the
> > C++29 P3104R6 - Bit permutations
> > paper.
> 
> Full bootstrap/regtest and further review revealed some problems:
> 1) as I wrote, just __glibcxx_assert( __l > 0 ) is enough even for
>    constant evaluation
> 2) the paper doesn't have noexcept on std::bit_repeat (supposedly because
>    it has precondition and if it is implemented using contracts?)
> 3) the uglification plugin revealed that the _log2Nd variable name doesn't
>    satisfy the requirements, renamed to __log2_Nd
> 4) the std exports plugin revealed I forgot to export them from std module
> 5) I've changed the bit_repeat<_Tp>(...) calls in bit_reverse fallback
>    to have std:: qualification; dunno where it is exactly needed and where
>    it is not, the header e.g. uses std::__countl_zero<_Tp>(...); or is
>    full qualification only needed for calls where ADL could change anything?
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2026-09-19  Jakub Jelinek  <jakub@redhat.com>
> 
> 	P3104R6
> 	* include/bits/version.def: Implement C++29 P3104R6 - Bit permutations.
> 	(bitops): Change value from 202606 to 202607.
> 	* include/bits/version.h: Regenerate.
> 	* include/std/bit (std::bit_repeat, std::bit_reverse,
> 	std::bit_compress, std::bit_expand): New function templates for C++29.
> 	* src/c++23/std.cc.in (std::bit_repeat, std::bit_reverse,
> 	std::bit_compress, std::bit_expand): New exports for C++29.
> 	* testsuite/26_numerics/bit/bit.permute/bit_reverse.cc: New test.
> 	* testsuite/26_numerics/bit/bit.permute/bit_repeat.cc: New test.
> 	* testsuite/26_numerics/bit/bit.permute/bit_compress.cc: New test.
> 	* testsuite/26_numerics/bit/bit.permute/bit_expand.cc: New test.

I'd like to ping this patch.
https://gcc.gnu.org/pipermail/libstdc++/2026-September/067839.html

Thanks

	Jakub



More information about the Libstdc++ mailing list