On 25/02/2013 22:57, Rich Freeman wrote:
> A sword that cuts two ways - judging understanding by an email is a
> dubious proposition, otherwise we wouldn't need job interviews.  :)
> It is just as likely that we're simply miscommunicating.

Did you not just say there:

"Calculating scroll bar movement is
exactly the sort of thing that this flag was actually designed for -
you don't care if it is off by 1/100th of a pixel."

or am I mistaken? If I'm not mistaken, that phrase is really not
understanding it.

The calculation that goes in painting on screen a scrollbar are hardly
something you expect -ffast-math to be designed for. Can you defend your
statement in any way?

> Define what you mean by "building *by itself*" - I don't want to
> assume I understand what you're getting at here.  I certainly wasn't
> suggesting that you could be able to run CFLAGS="-O2 -ffast-math"
> emerge chromium and get anything usable.  

Which is exactly what Tom complained about.

> -ffast-math is a flag that
> should be applied to specific functions or even parts of functions
> where there is an understood performance vs accuracy tradeoff.

Of course dealing with flags _per functions_ is not possible, as flags
apply at the very least to a translation unit...

> If you're just using it to calculate how many pixels down it is, it
> certainly shouldn't be that inaccurate.

But you're not just calculating how many pixels down to draw it...
you're calculating a bunch of parameters, including shades, shadows,
sub-pixel positioning, ....

> If you're using it to do
> pointer arithmetic or something then you're just going to get
> segfaults.

Uh.. no. Pointer arithmetic is, by and of itself, integer arithmetic.
That's not going to be influenced by -ffast-math.

Vastly, -ffast-math deals with floating-point arithmetic, which can be
sped up significantly ignoring some of the rules imposed by
floating-point arithmetic by IEEE/ISO standards. Breaking which, though,
can lead to seriously messed up results.

> There are arithmetic functions in computing that are
> discrete/functional in nature, and there are those which relate more
> to real-world measurements.  Adding a 0.001% error to a hash
> calculation breaks a hash.  Adding 0.001% error to a scientific
> calculation where all the components have 1% measurement error is
> insignificant.

But if you add 1% error to hundreds of small calculations ... well, you
should get the point, don't you?

There are decent use cases for -ffast-math... none of which involve a
desktop system, in my opinion.

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

Reply via email to