Date: Sun, 16 Feb 2025 12:23:26 -0600
> Whatever the compiler can do with _BitInt, it can do with a wrapper
for that type
Realistically if compilers want to have any hope of optimizing operations
involving these bit-precise integer types they are going to need to have a
_BitInt(N) type in the compiler. I don't really see a point of going out of
the way to allow implementations to not do this.
Cheers,
Jeremy
On Sat, Feb 15, 2025 at 5:59 PM Jan Schultke via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> On the note of bit-fields, I think this is a bit far-fetched. The
> point of bit-fields is usually to interact with individual bits or
> very small groups of them, and you don't need _BitInt for that. I
> don't think this is strong motivation in itself.
>
> Maybe I'm missing some obvious use case. Can you elaborate?
>
> On the note of implementation, I don't really understand your
> optimization concerns. The Clang C++ implementation is literally just:
>
> template <int N>
> struct bit_int {
> _BitInt(N) value;
> // ...
> };
>
> Whatever the compiler can do with _BitInt, it can do with a wrapper
> for that type. I'm not sure where those padding bits are meant to be
> coming from. The padding bits, if any, are in the underlying _BitInt.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
for that type
Realistically if compilers want to have any hope of optimizing operations
involving these bit-precise integer types they are going to need to have a
_BitInt(N) type in the compiler. I don't really see a point of going out of
the way to allow implementations to not do this.
Cheers,
Jeremy
On Sat, Feb 15, 2025 at 5:59 PM Jan Schultke via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> On the note of bit-fields, I think this is a bit far-fetched. The
> point of bit-fields is usually to interact with individual bits or
> very small groups of them, and you don't need _BitInt for that. I
> don't think this is strong motivation in itself.
>
> Maybe I'm missing some obvious use case. Can you elaborate?
>
> On the note of implementation, I don't really understand your
> optimization concerns. The Clang C++ implementation is literally just:
>
> template <int N>
> struct bit_int {
> _BitInt(N) value;
> // ...
> };
>
> Whatever the compiler can do with _BitInt, it can do with a wrapper
> for that type. I'm not sure where those padding bits are meant to be
> coming from. The padding bits, if any, are in the underlying _BitInt.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2025-02-16 18:23:38