3 ms·
Can you give details/ressources on how it is difficult to obtain identical FPU results on x86 and ARM? Not personally -- having already run into problems getti
by iainmerrick 9y ago
Can you give details/ressources on how it is difficult to obtain identical FPU results on x86 and ARM?
Not personally -- having already run into problems getting reproducible results on a single x86 machine with different compilers, I haven't even tried getting ARM to match!
Here's a long list of links on various issues: https://gafferongames.com/post/floating_point_determinism/ https://gafferongames.com/post/floating_point_determinism/
And here's a blog post that goes into detail on how to get reproducible results on x86: http://yosefk.com/blog/consistency-how-to-defeat-the-purpose-of-ieee-floating-point.html http://yosefk.com/blog/consistency-how-to-defeat-the-purpose... It's not too bad, but it sounds a bit fragile and I have no idea how well it would translate to other architectures. [Edit to add: hmm, actually, that post does say this is mostly just an x86 problem, or rather x87]
using "identical" implementations of more complex functions
That's a rather onerous requirement! Especially for multi-platform work. In almost all cases I'd like to be able to use the platform's math library, which is presumably well-optimized. Is there a good, reasonably efficient, highly portable implementation of math.h that gives fully reproducible results?
It seems to me (but I'd love to be convinced otherwise!) that if you really want reproducible results, fixed-point is a much better road to go down. Ints are just a lot more consistent than floats on pretty much every platform with a C compiler.