Re: floating point inconsistency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/15/2010 5:23 PM, Neil Ferguson wrote:
Christoph Groth wrote:

<snipped inconsistent floating point results>

This is on a computer with an Intel Core 2 CPU (I tried several
different variants).

If I take the second (-O1) binary and execute it on an Opteron it
produces the _first_ result.  Thus, the same static binary produces
different results on different processors!

This is a hardware-related effect - in a nutshell, it happens because Intel hardware can extend double-precision floating point operations to 80 bits internally, whereas AMD hardware usually enforces 64 bits at all times.

OP didn't indicate that -mfpmath=387 was used for the Intel run, vs. -mfpmath=sse for the AMD one. It has to be guessed that the rounding mode was set differently, or (if a 387 build) precision mode was set differently, or (if an sse build) gradual underflow was set differently. Both of you are too quick to blame gcc or Intel or AMD for something which almost certainly stems from other influences.

--
Tim Prince


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux