@@ -156,6 +156,10 @@ sign-extended to XLEN bits.
156156When passed in registers or on the stack, floating-point types narrower than
157157XLEN bits are widened to XLEN bits, with the upper bits undefined.
158158
159+ When passed in registers or on the stack, `__BitInt(N)`, unused bits are
160+ undefined, types narrower than XLEN bits are widened to XLEN bits, with the
161+ upper bits undefined.
162+
159163Scalars that are 2×XLEN bits wide are passed in a pair of argument registers,
160164with the low-order XLEN bits in the lower-numbered register and the high-order
161165XLEN bits in the higher-numbered register. If no argument registers are
@@ -457,6 +461,12 @@ alignments (based on the ILP32 convention):
457461| float _Complex | 8 | 4
458462| double _Complex | 16 | 8
459463| long double _Complex | 32 | 16
464+ | _BitInt(1 ≤ N ≤ 8) | 1 | 1
465+ | _BitInt(9 ≤ N ≤ 16) | 2 | 2
466+ | _BitInt(17 ≤ N ≤ 32) | 4 | 4
467+ | _BitInt(33 ≤ N ≤ 64) | 8 | 8
468+ | _BitInt(65 ≤ N ≤ 128)| 16 | 16
469+ | _BitInt(N > 128) | RoundUp(N / 128) * 16 | 16
460470|===
461471
462472LP64, LP64F, LP64D, and LP64Q:: Use the following type sizes and
@@ -484,6 +494,12 @@ alignments (based on the LP64 convention):
484494| float _Complex | 8 | 4
485495| double _Complex | 16 | 8
486496| long double _Complex | 32 | 16
497+ | _BitInt(1 ≤ N ≤ 8) | 1 | 1
498+ | _BitInt(9 ≤ N ≤ 16) | 2 | 2
499+ | _BitInt(17 ≤ N ≤ 32) | 4 | 4
500+ | _BitInt(33 ≤ N ≤ 64) | 8 | 8
501+ | _BitInt(65 ≤ N ≤ 128)| 16 | 16
502+ | _BitInt(N > 128) | RoundUp(N / 128) * 16 | 16
487503|===
488504
489505The alignment of `max_align_t` is 16.
@@ -493,6 +509,17 @@ The alignment of `max_align_t` is 16.
493509Structs and unions are aligned to the alignment of their most strictly aligned
494510member. The size of any object is a multiple of its alignment.
495511
512+ ==== _BitInt (N)
513+
514+ `_BitInt (N)` is the type defined in C23, allow user to define an
515+ arbitrary-sized integer type, where N is a postive integer larger than zero.
516+
517+ `_BitInt(N)` types are stored in little-endian order in memory. Bits in each
518+ byte are allocated from low to high.
519+
520+ Unused bits of the `_BitInt (N)` are unspecified when stored in memory or
521+ register.
522+
496523=== C/{Cpp} type representations
497524
498525`char` is unsigned.
0 commit comments