Date: Fri, 5 Sep 2025 22:28:40 +0000
But because the alignment of _BitInt is less strict an implementer must almost always assume that it is unaligned and implement the less efficient form of the algorithm.
It would have been no different than providing uint64_t[8].
So, in that sense it is identical to what we have right now.
Nobody is saying that you couldn't write an algorithm to do it. It's just that it would be very inefficient to do so. The same way we could have not cared for the alignment of any type.
But you would have been better of using a concrete type that signals to the compiler exactly what you want to do and have it guarantee you the right specs (size/alignment), and help it understand the type of operations you want to do.
Using _BitInt would have been detrimental in that sense.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]>
Sent: Friday, September 5, 2025 11:47:38 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Sebastian Wittmeier <wittmeier_at_[hidden]>
Subject: Re: [std-proposals] D3666R0 Bit-precise integers
If either the standard library or a user function define other operations beside arithmetic ones on it, they are available.
Why should they be UB, if implemented correctly?
If the implementation in the standard library or the user function uses a SIMD or SHA unit, those operations are accelerated by that hardware unit.
If data has to be moved from memory or general purpose registers to special registers of this hardware unit, it is moved by the implementation. If special alignment requirements have to be adhered to, the implementation will solve those.
So of course it will unlock everything, which somebody (standard or user library) implemented using those types.
Apart from that, even arithmetic operations on unusual bit sizes are a neat feature.
-----Ursprüngliche Nachricht-----
Von: Tiago Freire <tmiguelf_at_[hidden]>
Gesendet: Fr 05.09.2025 23:15
Betreff: RE: [std-proposals] D3666R0 Bit-precise integers
An: std-proposals_at_[hidden];
CC: Sebastian Wittmeier <wittmeier_at_[hidden]>;
Well, if all you want to do is integer arithmetic, it will allow you to do just that.
Everything else is UB.
It won’t unlock access to SIMD or similar.
It would have been no different than providing uint64_t[8].
So, in that sense it is identical to what we have right now.
Nobody is saying that you couldn't write an algorithm to do it. It's just that it would be very inefficient to do so. The same way we could have not cared for the alignment of any type.
But you would have been better of using a concrete type that signals to the compiler exactly what you want to do and have it guarantee you the right specs (size/alignment), and help it understand the type of operations you want to do.
Using _BitInt would have been detrimental in that sense.
________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]>
Sent: Friday, September 5, 2025 11:47:38 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Sebastian Wittmeier <wittmeier_at_[hidden]>
Subject: Re: [std-proposals] D3666R0 Bit-precise integers
If either the standard library or a user function define other operations beside arithmetic ones on it, they are available.
Why should they be UB, if implemented correctly?
If the implementation in the standard library or the user function uses a SIMD or SHA unit, those operations are accelerated by that hardware unit.
If data has to be moved from memory or general purpose registers to special registers of this hardware unit, it is moved by the implementation. If special alignment requirements have to be adhered to, the implementation will solve those.
So of course it will unlock everything, which somebody (standard or user library) implemented using those types.
Apart from that, even arithmetic operations on unusual bit sizes are a neat feature.
-----Ursprüngliche Nachricht-----
Von: Tiago Freire <tmiguelf_at_[hidden]>
Gesendet: Fr 05.09.2025 23:15
Betreff: RE: [std-proposals] D3666R0 Bit-precise integers
An: std-proposals_at_[hidden];
CC: Sebastian Wittmeier <wittmeier_at_[hidden]>;
Well, if all you want to do is integer arithmetic, it will allow you to do just that.
Everything else is UB.
It won’t unlock access to SIMD or similar.
Received on 2025-09-05 22:28:47