This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Porposal: Floating-Point Options


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)


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