This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i386 and x86_64 fenv support


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
joseph@codesourcery.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]