This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: "Joern Rennecke" <amylaar at redhat dot com>, <dewar at gnat dot com>
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: "Tim Prince" <tprince at computer dot org>
- Date: Tue, 31 Jul 2001 21:30:05 -0700
- Cc: <amylaar at redhat dot com>, <torvalds at transmeta dot com>, <aoliva at redhat dot com>, <gcc at gcc dot gnu dot org>, <gdr at codesourcery dot com>, <moshier at moshier dot ne dot mediaone dot net>
- References: <200108010150.f711o5T11981@phal.cambridge.redhat.com>
----- Original Message -----
From: "Joern Rennecke" <amylaar@redhat.com>
To: <dewar@gnat.com>
Cc: <amylaar@redhat.com>; <torvalds@transmeta.com>; <aoliva@redhat.com>;
<gcc@gcc.gnu.org>; <gdr@codesourcery.com>;
<moshier@moshier.ne.mediaone.net>; <tprince@computer.org>
Sent: Tuesday, July 31, 2001 6:50 PM
Subject: Re: What is acceptable for -ffast-math? (Was: associative law
in combine)
> > Actually what I had in mind was 80-bit on x86, and I don't think gcc
operates
> > that way by default?
>
> It just leaves the rounding mode alone, but some library code
> (glibc? newlib?) generally assumes it to be for 64 bit mantissa, i.e.
80 bit
> XFmode.
>
> OTOH, if a pseudo gets spilled, double gets a 64 bit stack slot, and
float
> 32 bit. So we get double rounding effects and inconsistent precision.
> The -ffloat-store option goes some way to mitigate these problems, at
a
> significant cost in performance. There was some discussion to set the
> rounding mode to 64 bit, but that would break library code that
assumes
> XFmode values, and would still get excess precision in borderline
cases:
> values that are IEEE denormals in 64 bit format are not denormal in
the
> register format, because the exponent part of the fp registers remains
> 16 bit no matter what the roundig mode is set to.
Spilling float calculations in double may produce double rounding only
when there are at least 2 operations between spills. If the rounding
precision is set to 53-bit double, it will make no difference whether
there is a spill. That may be an argument for this practice; I don't
that it is a primary one.
As newlib is intended to be independent of the presence of 80-bit
registers or not, and contains a great deal of code originally written
for SPARC, I don't see where it will be depending on XFmode. I believe
even glibc has been employed with fair success in 53-bit precision mode.