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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> (In reply to Jakub Jelinek from comment #6)
> > You can use -fexcess-precision=16 if you don't want treating _Float16 and
> > __bf16 as having excess precision.  With excess precision, I think the above
> > behavior is correct.
> > You'd need (int) (__bf16) 257.0bf16 to get 256 even with excess precision.
> 
> Ah, -fexcess-precision=16 doesn't seem to be documented though

I've noticed that too.

> (how does
> this influence long double handling then?)

ix86_get_excess_precision has all the details.  x86 has 4 different ways of
excess precision, one is not to use excess precision for anything, another only
for __bf16/_Float16 (promote to float), another one is promote everything to
long double and last is unpredictable.
With -fexcess-precision=fast, with -mavx512fp16 we don't promote anything,
without that to float.
With -fexcess-precision=16 we don't promote anything.
With -fexcess-precision=standard and the implicit case, it depends on
-mavx512fp16, -mfpmath=sse, -mfpmath=387, -mfpmath=both etc.

Reply via email to