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]

Re: What is acceptable for -ffast-math?


Just writing my thoughts here... I write (and use) a fair amount of
numerical code, mostly in the field of astronomical data
analysis/modelling. The proposals to rewrite slower expressions into
faster ones, eg

a/b/c -> a/(b*c)

would be a very useful one for the time consuming codes we run. This is
especially true for the C++ code I write, which needs significant
optimisation after inlining.

The point is, this would be an option which would be explicitly enabled,
and so there's no problem about breaking IEEE standards. In addition, if
one is writing code to handle numbers on the order of the maximum value in
a float/double, then there's a good argument that these types are
inappropriate. Losing, say, a factor of ten in any direction in a floating
point number wouldn't be a problem! As for the extra errors introduced by
rewriting expressions, this wouldn't be a problem: if one needs total
control over floating point, there's no reason to use -ffast-math!

Jeremy

-- 
Jeremy Sanders <jss@ast.cam.ac.uk>  http://www-xray.ast.cam.ac.uk/~jss/
Pembroke College, Cambridge. UK   Institute of Astronomy, Cambridge. UK



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