[RFC] Appropriate portable data type for IEEE half-precision on C/C++

Jonathan Wakely jwakely.gcc@gmail.com
Fri Mar 12 09:46:37 GMT 2021


On Fri, 12 Mar 2021 at 09:44, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> On Fri, 12 Mar 2021 at 09:38, Kito Cheng <kito.cheng@gmail.com> wrote:
> >
> > Hi Jonathan:
> >
> > > > C++ also has another proposal for extended floating-point types
> > > > (https://wg21.link/p1467), which included half-precision types, so in
> > > > my understanding, _Float16 won't be a portable typen between C/C++.
> > >
> > > Why not just make _Float16 available in C++ as a GCC extension?
> >
> > Not sure it would introduce any ABI issue or not? Especially the function
> > name mangling for _Decimal* types, or maybe we could just implement the
> > interchanged floating point type (_FloatN) part to C++ is fine?
>
> I would forget about the decimal types. I thought you were just
> talking about _Float16?
>
> You will need to decide on a mangling for it in C++, which should be
> co-ordinated with other compilers that are likely to support the type.
> You could mangle it as "u8_Float16" which is in the namespace reserved
> for vendor-extensions

That's documented at
http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin


More information about the Gcc mailing list