[phobos] phobos commit, revision 2186
Don Clugston
dclugston at googlemail.com
Sat Nov 20 22:19:34 PST 2010
On 21 November 2010 05:48, David Simcha <dsimcha at gmail.com> wrote:
> More research into this issue: I compiled the unittest.exe executable on my
> main (desktop) computer, ran it under my primary OS (Win7 64) and it
> failed.. I then ran the exact same executable (no recompile) on my Linux
> Partition (Ubuntu 10.10 64) using Wine and it failed.
>
> I then ran the exact same executable on my laptop on my primary OS (also
> Win7 64) and it passed. I ran it on my laptop's Linux partition under Wine
> (Ubuntu 10.10 32) and it passed.
>
> The only difference between the two systems that might account for this is
> that the laptop has an Intel Penryn CPU, whereas the desktop as an AMD
> Brisbane CPU. Does anyone know whether different x86 CPUs can produce
> subtly different floating point results when executing the exact same code?
> Alternatively, is it possible that some processor-specific optimizations to
> some function getting called by Don's code could be causing slightly
> different results?
That's _very_ interesting. The code in question doesn't use the C
runtime at all.
If it's the same exe, then the difference can only lie in the CPU or
in the environment.
Eg, if it starts with 80-bit floats disabled.
But the fact that every other test passes on your system, makes that
seem unlikely.
Does the failing system have execution protection enabled?
The only documented floating point difference between AMD and Intel
that I know of, is that AMD
raises the invalid exception when loading an 80-bit NaN, but Intel
doesn't. BTW I found that difference
myself, and added it to Wikipedia. That difference is not relevant here.
If the CPU itself is responsible for the difference, that's a CPU bug.
BTW this test was present in Tango for years, and nobody ever reported
this issue before.
More information about the phobos
mailing list