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

Kito Cheng kito.cheng@gmail.com
Fri Mar 12 09:57:52 GMT 2021


Hi Jonathan:

> 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 but if you wanted to assign a new shorter,
> non-extension then it should be discussed at
> https://github.com/itanium-cxx-abi/cxx-abi/issues (which will need to
> happen anyway if std::float16 is expected to go into the C++
> standard).
>
> Are you planning to support this in Clang too?

clang already supports _Float16 on C++ for a while, but only very few targets,
ARM, AArch64, SPIR and AMDGPU.

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

Seems like it is already defined for _FloatN types, and clang already
follow that.

::= DF <number> _ # ISO/IEC TS 18661 binary floating point type _FloatN (N bits)

Thank you, Jonathan, I'll start to add that to C++ :)


More information about the Gcc mailing list