On 9/5/25 10:57 PM, Andrew Pinski wrote:
On Fri, Sep 5, 2025 at 12:58 PM Matthias Kretz <[email protected]> wrote:

Matthias Kretz [Friday, 5 September 2025, 21:49:23 CEST]:
How about an assert that if words > 0, bitsize % 32 == 0?

I actually thought about an assert that bytes == 2 when words == 0. I don't
think there's a 1-Byte real type on any GCC target yet (though NVidia
apparently has hardware even for 4-Bit floats).

Hmm, would this fail for x86 long double, which is 80 bits? OK, just
checked. It's mangled as 12/16 bytes on i686/x86_64.

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 don't think there's value to making the mangled name longer by representing padding bits; it makes sense to only mangle the value representation.

On 9/5/25 9:49 PM, Matthias Kretz wrote:
n 9/5/25 1:03 PM, Matthias Kretz wrote:
Okay for trunk? What about backports?

Regarding backports, I'm generally reluctant to change mangling within a
release unless the old behavior would always fail loudly.  This case
looks borderline; it could have worked for a single overload.

So I'm inclined to say no backports, and control it with -fabi-version
in 16.  But I'm open to argument.

In my case it was super strange because inlining made the problem go away most of the time. But when it happened it was very puzzling; with the assembler complaining about a symbol getting defined a second time. With a symbol that cannot be demangled by c++filt.

I would assume that float16_t template arguments are rather niche and barely useful. (I use it for test code for std::simd::vec<std::float16_t>.) Also float16_t + float template args are C++20 and up, which is still experimental, right?

Good point, I guess we don't need it to depend on -fabi-version.

+  if (words == 0)
+    {
+      int bytes = bits / 8;
+      sprintf (buffer, "%04lx", (unsigned long) target_real[0]);
+      if (bytes == 2)
+       write_chars (buffer, 4);
+      else
+       write_chars (buffer + 2, 2);

This seems backwards?

+      return;
+    }

Reply via email to