On 25/02/2013 23:21, Rich Freeman wrote:
> On Mon, Feb 25, 2013 at 5:11 PM, Diego Elio Pettenò
> <flamee...@flameeyes.eu> wrote:
>> Of course dealing with flags _per functions_ is not possible, as flags
>> apply at the very least to a translation unit...
> 
> A translation unit can contain a single function, or a bunch of
> functions that you want to apply the flag to.

Which is a different story altogether. By the way just so you know, as
you seem to talk a lot about things you understand only partially, if
you want performance so badly you want to use -ffast-math, you're not
going to split translation units so much.

> Maybe it wasn't a great example - I wasn't the one who first brought
> it up in the thread.

No, an example of _how building a whole package with -ffast-math_ was
brought up, and you turned it into "something that it should apply to"
(which is false, and stupid to say).

Note also how you can't defend your original statement, so I maintain my
point: you're speaking of things you don't know.

> If you add a randomly distributed 1% error to hundreds of small
> calculations you end up with a 1% error in the result, roughly
> speaking.  The exact impact can in fact be calculated using
> propagation of error.  Of course, if -ffast-math introduces a
> non-uniform bias and the calculations are sensitive to that then that
> could carry things further off.

On the distribution of errors introduced by -ffast-math I have no data.
On the other hand, I know that if you start changing 1% of the
calculation in a single piece of software, what you end up with is
rarely "within 1%" of the intended result.

Software does not work like a single equation. Ever heard of fuzzing?
You know why it works? Because a single different bit can have cascade
effects.

> 2.  If individual packages DO carefully use -ffast-math and that
> breaks, it might be a valid bug, and may or may not be a blocker
> depending on real-world impact.  That doesn't mean users sticking it
> in their CFLAGS - it means the ebuild or upstream build system
> carefully applied the flag appropriately.

This is arguable — I'm not going to dig down how many packages I found
with -O3 (or even worse -O9), just for the sake of being "faster" and
sometimes going slower than if built with -O2 (loops unrolling and
inlining are not always a good idea).

But, as you correctly say this time, right now we only have one _valid_
report: mednafen — which I'm surprised uses -ffast-math (given it's an
emulator). So the question is whether that's a showstopper for them or
not — and how serious is the performance difference between the two.

Anything else, is noise.

-- 
Diego Elio Pettenò — Flameeyes
flamee...@flameeyes.eu — http://blog.flameeyes.eu/

Reply via email to