[Bug libgcc/108279] Improved speed for float128 routines

wilco at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 18 20:10:47 GMT 2023


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

--- Comment #21 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #20)
> __attribute__((noinline, optimize ("rounding-math"))) static int
> round_to_nearest (void) { return 1.0f - __FLT_MIN__ == 1.0f + __FLT_MIN__; }

Wouldn't that always set inexact?

> and
>   if (round_to_nearest ()) \
>     _fcw = FP_RND_NEAREST; \
>   else \
>     __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \
> 
> Except that from _fcw we don't determine just the rounding mode but also
> what exceptions are enabled.

Yes that wouldn't work in fenv but FP emulation functions don't need to read
the exception flags.


More information about the Gcc-bugs mailing list