In memory. And for some settings (e.g. with the Intel compiler) x86 and x64 architecture chips can perform 80 bit intermediate calculations.rbarreira wrote:Where do you propose that these 10-byte floats with extra precision are stored, if not in registers? How does the CPU calculate on them?Dann Corbit wrote:It is possible, for instance, for 4 byte floats to have calculations performed using 8 byte intermediate results. Or for 8 byte floats to have intermediate calculations performed using 10 byte floats. If an IRQ happens, then the results do get saved in registers: 4 byte registers and 8 byte registers, respectively, trimming off a few bits of intermediate precision.rbarreira wrote:I'm with you, unless someone comes up with a reasonable explanation why interrupts would change the behavior of a program. During any context switch the OS is supposed to store the exact content of all CPU registers, and I've never heard of any rounding taking place for floating point registers during this process...Eelco de Groot wrote:Excuse the interrupt Dann, but does that sound very strange. An interrupt can cause the result of a floating point calculation to be rounded off or terminated earlyDann Corbit wrote:It would not surprise me if there were differences. Despite optimization obeying the 'as-if' rule, re-ordering of instructions or which branch is taken first could easily affect (for instance) the shape of a tree that is being searched.gaard wrote:Should the analysis between these versions, even with 'deterministic' turned on, differ?
Also, Komodo uses floating point for evaluation and so (for instance) an interrupt can shave off the high order bits used for intermediate calculations so that even the same version can produce slightly different results at times.![]()
Would that not invalidate our computers for any serious mathematical, statistical or otherwise scientific application. Or are these interrupts designed into Komodo only? Could the intermediate results not be stored and resumed correctly after the interrupt? How long has this been going on and can we blame Bill Gates
![]()
Nondeterministic behaviour with Stockfish -different behaviour compared to a stock compile I mean- was I recall the result of a wrong optimization behaviour in the compilation, but I would not know if Komodo is less deterministic. Is that not problematic for bughunting for instance, I suppose that is why there is a switch?
Eelco
However, it is true that different compilers may give different results for floating point formats, particularly when unsafe optimizations are enabled (which they sometimes are even without an explicit command line parameter to enable them).
These things can be controlled to some degree by compiler options.
Data objects are stored in memory and calculated in registers. If, during a calculation that is allowed to use the 80 bit registers for intermediate results an IRQ happens or some other context switch, it is possible that an 80 bit intermediate result is stored into an 64 bit register.Are you saying that there's a "magic area" on the CPU where extra precision is stored and which doesn't get saved on context switches?
I suggest that you start with the Intel, GCC and Microsoft compiler documentation. Anyone who has studies numerical analysis knows fully well about this and does not find it surprising at all.I was unable to find anything backing this up and I highly doubt that it's the case.
It is, and that is the problem.Everything I've read about context switching indicates that all register content, including floating point, is saved and restored by the OS.
Look up the GCC flag -ffast-math and see, for instance:On x86 there is a hardware context switch which doesn't save floating point stuff, but it seems that common operating systems don't use it precisely for that reason.
http://forums.anandtech.com/showthread.php?t=1796118
Look up the Microsoft flag fp:fast and see what effect it has on calculations and why.
See the description of the Intel compiler flag fast[=1|2] and see what effect it has on results and why.
Of course, it could be all in my imagination.