Re: i386 and x86_64 fenv support

Joseph Myers <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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 defined 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
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.