Hi! On Wed, Sep 09, 2020 at 02:42:36PM +0100, Jonathan Wakely wrote: > On Fri, 7 Aug 2020 at 22:14, Michael Meissner <meiss...@linux.ibm.com> wrote: > > But assuming we want compatibility with libraries like glibc and libstdc++, > > I > > think we will have to continue to use "g" for __ibm128.
Yes. > > With the long double change, I tend to view this as an ABI change. You can use both __ibm128 and __ieee128 in one program, so it isn't an ABI change. Only the default of what "long double" means changes. And we have been there before, there is the "e" mangling as well... > > I would propose using a new mangling for IEEE 128-bit long double. I would > > prefer to get agreement on what the new mangling should be so we don't have > > an > > issue like we had in GCC 8.1 going to GCC 8.2, where we changed the > > mangling, > > and had to provide aliases for the old name. > > > > At the moment I think the mangling should be: > > long double "g" if long double is IBM > > long double "u12_ieee128_ld" if long double is IEEE Why? Why can't this be exactly the same as __ieee128? > > __float128 "u9__ieee128" > > __ibm128 "g" (There is DF128_ as well btw, oh joy). > What's the benefit of having __float128 and IEEE long double be > distinct types? That complicates things for libraries like libstdc++. Yeah. > If we want to support using "__float128" with C++ iostreams then we > need yet another set of I/O routines, even though it's identical to > one of the types we already handle. Why not just keep __float128 and > __ieee128 and "long double when long double is IEEE" as three > different aliases for the same type, so that C++ code like > _Z4funcu9__ieee128 works for all of them, instead of needing to also > define _Z4funcu12__ieee128_ld? Both __ieee128 and __float128 are in the implementation namespace, so we can do whatever we want with it, indeed. > What about the "__ieee128" type, would that be mangled as > "u12_ieee128_ld" or "u9__ieee128"? The latter. Anything else would be an ABI change. > Currently it's the latter, i.e. __ieee128 is the same type as > __float128, which is the same type as "long double when > -mabi=ieeelongdouble". That seems useful to me, because it means that > I can always use either __ibm128 or __ieee128 to refer to "the type > that is sometimes known as 'long double'" irrespective of which -mabi > is actually used. Yes. > I'd also find it surprising if __ieee128 is not mangled to u9__ieee128 > since that's its name :-) But that's far less important than the > practical matter of which types are mangled to the same and which > overloads are equivalent to each other. Mangling to u12__ieee_128_ld means we have a type named __ieee128_ld. We don't. Segher