This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: The perennial i386 floating-point rounding issue...
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Cc: Zack Weinberg <zack at codesourcery dot com>, <gcc at gcc dot gnu dot org>
- Date: Sat, 8 Jun 2002 01:13:53 +0100 (BST)
- Subject: Re: The perennial i386 floating-point rounding issue...
On Sat, 8 Jun 2002, Fergus Henderson wrote:
> local variables would change spontaneously. But using extended precision
> for intermediate expression results is fine, because this is permitted
> by the C standard's abstract semantics:
>
> | 5.2.4.2.2 Characteristics of floating types <float.h>
> |
> | [#7] The values of operations with floating operands and
> | values subject to the usual arithmetic conversions and of
> | floating constants are evaluated to a format whose range and
> | precision may be greater than required by the type.
Only as long as we set FLT_EVAL_METHOD properly. It ought to be -1 if
intermediate values might or might not be 80-bit depending on whether
spilled, but 2 (which it is at present) only if all intermediate
calculations are genuinely 80-bit. (And maybe something else again if
using SSE for floating point. The i386 back end needs to define
__FLT_EVAL_METHOD to the right value depending on all these factors, and
the header should then #define FTL_EVAL_METHOD __FLT_EVAL_METHOD.)
--
Joseph S. Myers
jsm28@cam.ac.uk