Boost logo

Boost :

From: Hans Meine (meine_at_[hidden])
Date: 2006-11-16 09:51:58


Hi!

On Thursday, 16. November 2006 02:56, Lubomir Bourdev wrote:
> > Unfortunately, the CPU itself violates rule 3: a double in a
> > register and the same double written to memory and read back
> > need no longer compare equal - a behavior that is really hard
> > to debug :-(
>
> Well, the world will never be perfect, but that doesn't mean we
> shouldn't strive for perfection :-)
> (That seems quite a serious problem though! Can you point me at a
> document describing this? Which CPUs are affected?)

GCC manual, section 10.8:
On 68000 and x86 systems, for instance, you can get paradoxical results if you
test the precise values of floating point numbers. For example, you can find
that a floating point value which is not a NaN is not equal to itself. This
results from the fact that the floating point registers hold a few more bits
of precision than fit in a double in memory. Compiled code moves values
between memory and floating point registers at its convenience, and moving
them into memory truncates them.

Better, here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

> [...] The disadvantage is that
> built-in types will rarely be used as GIL channels, which could have
> performance implications due to abstraction penalty (and I do have data
> to demonstrate such performance penalty exists)

I would be interested in that, where can I find it?

-- 
Ciao, /  /
     /--/
    /  / ANS

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk