C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Bit permutations

From: David Brown <david_at_[hidden]>
Date: Tue, 23 Jan 2024 13:39:10 +0100
On 22/01/2024 14:23, Jan Schultke via Std-Proposals wrote:
> The latest version of the proposal is now viewable at
> https://eisenwave.github.io/cpp-proposals/bit-permutations.html
>
> On Fri, Jan 19, 2024 at 10:22 PM Jan Schultke
> <janschultke_at_[hidden]> wrote:
>>
>> Please find attached a proposal draft for bit permutations in <bit>.
>> The most recent source can also be found at
>> https://github.com/Eisenwave/cpp-proposals/blob/master/src/bit-deposit-extract-reverse.html
>>
>> In short, this adds functions for reversing bits and
>> compressing/expanding them with a mask, like the RBIT ARM, and
>> PEXT/PDEP x86_64 instructions respectively.
>>
>> I'd love to hear your thoughts :)

It might help to give a few more examples for some of these functions,
or even show their effect in diagram form. Bit reversal is clear
enough, but the others are much less obvious. That makes it hard to see
what they are doing, and why they might be useful. I am sure they are
extremely useful in the right circumstances, but I don't think they are
likely to be particularly common or familiar to users.

If these operations correspond to existing extensions (such as gcc or
clang builtins), that would also be worth mentioning, as would
corresponding assembly instructions or intrinsic names for x86-64 and
ARM (32-bit or 64-bit). People who currently write software that uses
these operations might be familiar with the assembly instructions -
these will be the people for whom this proposal is most relevant.

David

Received on 2024-01-23 12:39:19