This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: i386 and x86_64 fenv support
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Howland, Craig D. - US" <craig dot howland at caci dot com>
- Cc: Newlib <newlib at sourceware dot org>
- Date: Tue, 27 Aug 2019 19:47:49 +0000
- Subject: Re: i386 and x86_64 fenv support
- Ironport-sdr: 4TJXgcA5VaYYiIRPdUxQibnc2jwT3tW5SRHyL4AQM5CJ+z2nrHQd+V8De+ayQrLKmGpKP8f9zl sHTtqh3LpbvPaJ/de+9n724UHzeMj4BE4AamrWCmFQLj3KhAcu2Kma4UDfs2whVhjqYUhYZow2 jiiDnHzpcvtqrFW1TDExA1XlyGlyJ0vvMgQ3tR95M1Ap2w1Ocq3DA9t7jlEKlK4kU3Vn3WIeEo nneK5+x8rV/HSww62+X9c+0LgP5b5We4nlQX2MCk4b8rINBcSr1amGO/yWbgphdxLhOATXFY4o NfU=
- Ironport-sdr: NKKG6Pdz8ueJVVjQEx+zTmNJB9YdVb2ozqYQ9XbjHF1+6u/RYBvUdwdHErfYZ31gTjtyhYRd08 tZSWHoe/IN4+9kTTgApBHyWD5AC4EFvtY3cuQP9y4Ow5kuEEtEby5UfAqJJq6/grO0ax56So7w fC4fElSnfdg3H+OAvqK1Q3xbCwbL3M0O79phEQSQYcd2KnOZQlOwUEWMrdTXPfoMxt2OMxjZ1z hwDx/BnZi1MlmRPOEri5AuK9r/jk9l1FX7AXaJgvFf1VBvuW+1Hbic9qHzYd7zj4A+DZbRpAHc fdQ=
- References: <CAF9ehCWrHVR3MAojGHEVwLp=44D7F-mE96Frr4fHyzkyPrU8ag@mail.gmail.com> <alpine.DEB.2.21.1908271709170.25774@digraph.polyomino.org.uk>,<CAF9ehCXyEbaciR0b2YSh4HaoUBbFN546u61H8xL8D6uvusppjA@mail.gmail.com> <1566928274715.79162@caci.com>
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