[Dwarf-Discuss] Multiple floating point types with the same size but different encodings

Jakub Jelinek jakub@redhat.com
Mon Jan 24 22:16:50 GMT 2022

On Mon, Jan 24, 2022 at 04:52:38PM -0500, Jason Merrill wrote:
> DW_ATE seems natural, since that's how we express the encoding of a base
> type.  OTOH, using DW_AT_precision would parallel DW_AT_digit_count for
> fixed-point encodings.  My concern is that it would be possible to have
> multiple alternative encodings with the same precision, but perhaps that's
> not sufficiently likely?

Guess advantage of a special DW_ATE_* for it is that it is smaller,
DW_AT_encoding has to be specified either way, while we have
DW_FORM_implicit_const, that will take something at least in .debug_abbrev.
The types we see used together right now (i.e. this double double vs.
quad IEEE or float16 vs. bfloat16) do differ in precisions.
There are some differences in some cases even with the same precision,
e.g. in NaNs (mips vs. rest), but those don't appear together, or the
VAX floats (but I think on a VAX one will see only those 3 floats there
and they have different precisions too (24, 53 and 56)).

The special DW_ATE_* values would need to be in the user range though,
while DW_AT_precision could be something explained in DWARF6.


More information about the Dwarf-discuss mailing list