On 9/8/25 4:29 PM, Jakub Jelinek wrote:
On Mon, Sep 08, 2025 at 04:03:21PM +0200, Jason Merrill wrote:
On 9/8/25 8:11 AM, Matthias Kretz wrote:
Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]:
It seems that Clang and GCC disagree on mangling 80-Bit long double:

https://compiler-explorer.com/z/W1d64PjrP

I like Clang's interpretation of
https://itanium-cxx-abi.github.io/cxx-abi/
abi.html#mangle.float better.

"corresponding to the internal representation" But interpretations
seems valid since there is no mention of the padding bits.
I think GCC is better because it includes the full padding bits.

I interpret "internal representation" to say that not the decimal value is
printed but rather the bits in memory that make up the floating-point value.
And padding bits don't contribute to that value.

I wrote "like" above. I have no idea about the wording intent. But using the
shorter mangling, and a mangling that is the same on 32- and 64-bit seems
preferable. Which is why I "like" it more.

I agree.  Can you address that in this patch as well?

That would be an ABI change, so should depend on -fabi-version= because
unlike _Float16 or std::bfloat16_t literals, I think long double literals
will appear pretty frequently.

Also, the question is if we don't use the TYPE_SIZE_UNIT or TYPE_SIZE
to determine how many hex digits to print, what else should be used.
For decimal floating point, I think we need to keep doing what we used
before, the 32/64/128-bit case are desirable (though unsure if it is ok that
the dfp literals will mangle differently on s390/ppc compared to all other
targets because they use different encodings).  Anyway, dfp has p (see
below) 7 (32 bits), 16 (64 bits) and 34 (128 bits).
For binary floating point, perhaps use
REAL_MODE_FORMAT (TYPE_MODE (type))->p ?

How about MODE_PRECISION (TYPE_MODE (type))?

Jason

Reply via email to