https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109924

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Why do you need that?
The std::bfloat16_t builtins are intentionally limited to only what is really
required, there is no support in libc for that type whatever and only minimum
needed in libgcc.
A quiet NaN can be created as (decltype (0.0bf16)) __builtin_nanf ("") etc.
The reason there is __builtin_nansf16b builtin is that the above doesn't really
work for signalling NaNs, as on the cast an exception is emitted and the sNaN
turned into a qNaN.
Similarly, there is __builtin_nextafterf16b builtin so that this operation can
be folded for constexpr.  Most other operations on bfloat16_t as can be seen on
the libstdc++ implementation or even what gcc emits for such arithmetics on the
type is promote to std::float32_t, perform operation in the wider mode and then
cast back (and the fact that the compiler implements excess precision for that
type).

Reply via email to