On Wed, Jul 29, 2026 at 01:53:26PM +0200, Stefan Schulze Frielinghaus wrote:
> > The ugly thing about the x86_64 (or s390x) decision that some people
> > don't like is that we have the __int128 type and that passing of
> > _BitInt(N) for N in [65, 128] may differ from __int128 (on x86_64
> > actually it doesn't), and more importantly that
> > alignof (__int128) != alignof (_BitInt(128)).
> 
> Can you elaborate on that?  On s390x, alignment/size of __int128 and
> _BitInt(128) are the same and both are passed via memory.  Also
> _BitInt(N) with 64<N<128 should have same sizeof/alignof as __int128 and
> being passed via memory.  Since those _BitInt(N) even require extension,
> there shouldn't be any difference compared to __int128.
> 
> That being said, it was deliberate to make __int128 and _BitInt(128)
> behave the same.  Otherwise we could have went for passing _BitInt(128)
> via vector registers for example.

Ah, sorry, indeed s390x has alignof (_BitInt(128)) == 8.
On x86_64 it stands though.
And, note, even for __int128 the alignof is doable without going to 128-bit
ABI limbs, by simply having special cases for sizes up to 128 bits
inclusive.  Just alignof (_BitInt(129)) would be strangely smaller than
alignof (_BitInt(128)).
        alignof sizeof  multilimb
n <= 8    1      1      false
n <= 16   2      2      false
n <= 32   4      4      false
n <= 64   8      8      false
n <= 128 16     16      false
n > 128   8     (n+63)/64*8     true

        Jakub

Reply via email to