This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC beaten by ICC in stupid trig test!
- From: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
- To: gcc at gcc dot gnu dot org
- Cc: Roger Sayle <roger at eyesopen dot com>, Robert Dewar <dewar at gnat dot com>, Bradley Lucier <lucier at math dot purdue dot edu>, Toon Moene <toon at moene dot indiv dot nluug dot nl>, Scott Robert Ladd <coyote at coyotegulch dot com>, <gcc at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Mar 2004 09:08:45 -0600
- Subject: Re: GCC beaten by ICC in stupid trig test!
Roger Sayle wrote:
> I've heard it argued that people who are serious about floating point
> don't use -ffast-math. I consider myself serious, and make a very nice
> living from selling software to solve finite-difference Poison-Boltzmann
> electrostatic calculations on regular grids, and molecular minimizations
> using quasi-newtonian numerical optimizers. Toon does numerical weather
> forecasting, and he seems happy with -ffast-math. Laurent performs large
> scale Monte-Carlo simulations, and he also seems happy with it.
I would like to add to this one more voice. We distribute our finite element
code for some 5 years now, with >200 downloads a month. We haven't, ever,
heard someone complain that we include -ffast-math in our flags for optimized
builds. I have also not ever heard someone in the finite element community
think about the effects of correctly treating NaN etc (if your PDE simulator
generates NaNs, then you have a bug), or worrying about the order of
execution of a+b+c. In fact, I most often use parenthesis to make code more
readable, and never to force the order of evaluation in a+b+c. If you start
to worry whether a+b+c is different than a+c+b, then a simulator must be so
instable that any prediction it gives must necessarily be almost useless.
Frankly, it makes me angry if people here keep repeating that "any
self-respecting numerical programmer can't possibly use -ffast-math and must
necessarily know and care which way a+b+c is evaluated". I claim that this
is, in almost all cases, wrong. This view is anal, I can't track the order of
evaluation of operands in a program or a quarter million LOC. Please stop
asserting these things.
If it were for me, then we should make -ffast-math the default with -O2, and
allow for reassociating arguments by default. If by things like fused
multiply-add we can save another 10%, then that's almost one day off my
week-long computations! Those few who do care about these things are free to
use the respective flags.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ices.utexas.edu
www: http://www.ices.utexas.edu/~bangerth/