Skip to content

Commit

Permalink
Rationale document for bit-precise types _BitInt
Browse files Browse the repository at this point in the history
This type has been added into the C2x specification, alongside changes
to describe how they are represented at a machine level we also add a
design document describing the rationale behind the choices we made.

One of the main contentious issues has been around the alignment of
large _BitInt types.  In this document we have chosen to specify that
large _BitInt's are treated as if they were an array of double-register
sized chunks.

Other psABI's have chosen to represent large _BitInt's as an array of
single-register sized chunks.  This means that differences in alignment
might be surprising to developers attempting to write portable code.
However in contrast we believe that developers familiar with ABI's for
Arm Architectures would be less surprised by this decision.

N.b. I happened to also notice a stack overflow question which was
suggesting the use of _BitInt(128) for u128.  Given the discussion did
not have any mention of the different ABI between this and __uint128 I
would take it as evidence for a benefit to having the two integrals ABI
match.
https://stackoverflow.com/questions/16088282/is-there-a-128-bit-integer-in-gcc
  • Loading branch information
mmalcomson committed Sep 27, 2023
1 parent ad4f088 commit 2a3ec7e
Showing 1 changed file with 506 additions and 0 deletions.
Loading

0 comments on commit 2a3ec7e

Please sign in to comment.