This is the mail archive of the
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Linus Torvalds <torvalds at transmeta dot com>
- Date: Mon, 30 Jul 2001 18:30:48 -0700 (PDT)
- cc: Fergus Henderson <fjh at cs dot mu dot oz dot au>, <moshier at moshier dot ne dot mediaone dot net>, <tprince at computer dot org>, <gcc at gcc dot gnu dot org>
On 30 Jul 2001, Gabriel Dos Reis wrote:
> | Who are you to say that the user wouldn't like the code to be run faster?
> Who are you to say that it is more important to compute wrong and fast
> than computing correctly?
Why do you think it's necessarily wrong?
The _only_ person who can judge whether it's wrong to do so it the person
who wrote the program. He may be happy with the faster code. He's almost
certainly happy if he used "-ffast-math".
> If correctness is not an issue then the fastest way is to avoid the
> computation entirely or return 0.0 unconditionally.
Blather blather. According to your notion of correctness.
> | Note that with the current -ffast-math on x86, for example, gcc will
> | already inline things like "sin()" etc using the x87 instruction directly.
> I don't buy the argument
> That is broken, then we should break this as well
It's not broken, you silly boy.
THAT IS THE WHOLE REASON FOR THE "-ffast-math" option.
Go back and look at why it was added. Right - exactly so that people could
get _fast_ math, when they do not care about the inexactness that isn't
even an issue for most people.
> As von Neumann said once
> Numerical computation is too serious to be left to the computer
Yeah. And as Linus once said: most numerical problems today in pure CPU
cycles are actually 3D games.
Your arguments about "numerical computation" are just silly, as you don't
seem to realize that there are tons of problems where your theoretical
issues are nothing more than noise.
It's not "incorrect" to say that you want the result faster, even if that
result doesn't match your theoretical models.
And remember: in the end, the goodness of _any_ program (including a
compiler) is how well it solves real-world problems. Whether you like the
transformation or not as anumerical scientist has absolutely nothing to do