Issue 230529.1: Bit-precise Integer Types

Author: Jakub Jelinek
Champion: Jakub Jelinek
Date submitted: 2023-05-29
Date revised:
Date closed: 2023-11-27
Type: Enhancement
Status: Accepted
DWARF Version: 6


C23 (see draft) is introducing signed and unsigned _BitInt(N) types. These can express much larger precision than standard or even extended integral types, can have different ABI for argument passing/returning valuess from normal integers.

While I guess one could represent those with

DW_AT_encoding  DW_ATE_signed   // or DW_ATE_unsigned
DW_AT_bit_size  238
DW_AT_byte_size 32
DW_AT_name      "_BitInt(238)"

requiring parsing of the DW_AT_name and special-casing _BitInt used in there for the ABI handling would be awkward. So, I think it is better to use new DW_ATE_* values for this.

Proposed Changes

Table 5.1 - add

Bit-precise integer types
DW_ATE_signed_bitint    bit-precise signed integer
DW_ATE_unsigned_bitint  bit-precise unsigned integer

Add Bit-precise integer types

Bit-precise integer types (DW_ATE_signed_bitint, DW_ATE_unsigned_bitint) are supported in C23 (_BitInt(N) and unsigned _BitInt(N)) and are not discussed further.

Table 7.11 - add

DW_ATE_signed_bitint ‡          0x17
DW_ATE_unsigned_bitint ‡        0x18

2023-11-27: Accepted.