i386 and x86_64 fenv support
Tue Aug 27 19:48:00 GMT 2019
On Tue, 27 Aug 2019, Howland, Craig D. - US via newlib wrote:
> That GLIBC requirement violates what the standards say. C99 says, "Each of
> the macros FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO FE_UPWARD is deï¬ned if and
> only if the implementation supports getting and setting the represented
> rounding direction by means of the fegetround and fesetround functions."
If to-nearest is the default and only rounding mode, setting it is a
no-op, so it would violate the standard not to define FE_TONEAREST, would
violate the standard not to return success from fesetround (FE_TONEAREST)
and would violate the standard not to return FE_TONEAREST from fegetround.
If a processor does not support rounding to-nearest (Cell SPU for
single-precision, for example), of course FE_TONEAREST would not be
defined (the C standard model doesn't really cover the SPU case where
single-precision is only FE_TOWARDZERO but double precision handles all
rounding modes, however).
Joseph S. Myers
More information about the Newlib