This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Porposal: Floating-Point Options
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Geoffrey Keating <geoffk at geoffk dot org>
- Cc: Scott Robert Ladd <scott dot ladd at coyotegulch dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 16 Jun 2005 15:09:49 +0000 (UTC)
- Subject: Re: Porposal: Floating-Point Options
- References: <42AEEA99.70408@coyotegulch.com> <m2d5qoilsg.fsf@greed.local>
On Tue, 14 Jun 2005, Geoffrey Keating wrote:
> So, what I think you want to do is to add another flag under
> -ffast-math, perhaps called -fwiden-math, which specifically allows
> the compiler to compute values in a wider mode (that would be 80-bit
> x87 FP) even when ISO C doesn't allow it. You would have this flag on
> by default on x86.
I suggest the name -fno-float-store, since -ffloat-store is the flag meant
to yield better conformance with the standard requirements for excess
precision (which only does so for explicit assignments at present).
Implementation outline: stop x86 back end from claiming to support
float/double operations when it doesn't; teach C and C++ front ends to
distinguish two types for an expression, the type used for computation
(always long double for x87 floating point) and the logical type at the C
language level; ensure that in conforming mode all conversions from long
double to double or float are executed properly but in nonconforming mode
allow them to be discarded; ensure that -ansi / -std=c89 / -std=c99 / ...
enable -ffloat-store on platforms with excess precision.
A cast from double to double would look like (long double)(double)(long
double value) (final type double) in the front end trees - an expression
with semantic type double but represented as long double is converted to
the range and precision of double, then back to long double for any
further arithmetic in that expression but with the semantic type remaining
as double.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)