On Wed, Nov 05, 2025 at 03:48:46AM -0500, Michael Meissner wrote:
> This set of patches is a request for comments (RFC) on the support to
> add 16-bit floating point support to the GCC 16 PowerPC.  In GCC 16, I
> anticipate this will be listed as an experimental feature, to allow
> the code to be refined by the time GCC 17 ships.
> 
> There are 2 popular 16-bit floating point formats.

One thing I'm missing in the patchset is libstdc++-v3 part of this.
I assume that with -mfloat16 -std=c++23 g++ will predefine the
__STDCPP_FLOAT16_T__ and __STDCPP_BFLOAT16_T__ macros (some g++.target/powerpc
test should test that), so that enables all of libstdc++ std::float16_t
and std::bfloat16_t support.
Now, for <charconv> std::from_chars and std::to_chars overloads the
__{from,to}_chars_{,b}float16_t helper functions are exported from libstdc++
for some years already whenever _Float32 is defined (i.e. when float is IEEE
single) at some older symbol version (because those functions just use float
rather than _Float16 or decltype (1.0bf16) types in their ABI).
But _ZTI{,P,PK}DF16{_,b} symbols needed for std::float16_t and
std::bfloat16_t RTTI are presumably not exported from libstdc++ and would be
when libstdc++ is built with -mfloat16 and are actually needed in this
patchset even when libstdc++ isn't built with that option, because code
built with -mfloat16 -std=c++23 can use typeid (std::float16_t) or
typeid (std::bfloat16_t) etc.
But it needs to be exported with the right symbol version (if it is
introduced in GCC 16, then CXXABI_1.3.17 rather than CXXABI_1.3.14 or not at
all), because it wasn't available in GCC 13.
Partly see https://gcc.gnu.org/PR118563 , but in this case for PowerPC you
actually need more than that, it is not about just the _ZTI{,P,PK}DF16b
symbols, but also _ZTI{,P,PK}DF16_, and I guess you also need to arrange
for libstdc++-v3/libsupc++/fundamental_type_info.cc being compiled with
-mfloat16 on PowerPC.

        Jakub

Reply via email to