C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D3666R0 Bit-precise integers

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Sat, 06 Sep 2025 06:46:04 +0100
On 6 September 2025 05:03:51 BST, Paul Caprioli via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
>> Actually, you can't infer the alignment from the headers. You can see in the
>> definition of __m128i in the GCC headers that it lacks the __aligned__ portion
>> too, so all those types should have had the alignment of "long long" (8) but
>> don't. It's implemented in the compiler itself.
>
>I did see that! Thanks for saving me the trouble of trying to track it down.
>
>But given the compiler-dependent alignment differences, it seems one cannot portably use this type in a structure because different compilers on the same platform will pad differently. I don't want to do this anyway, but where is it written I can't?
>
>If I understand correctly, these types are not part of the platform ABI. That's the answer, right?
>
>So, what's the plan for _BitInt?
>

It's already in the x86-64 psABI (page 18):

https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/9388606854/artifacts/raw/x86-64-ABI/abi.pdf

Received on 2025-09-06 05:46:14