Sort out FP rounding modes
|Reported by:||Philip||Owned by:|
SpiderMonkey likes to change the FPU rounding mode (see "Rounding difference between JIT and interpreter") to guarantee consistency. We need to guarantee consistency in SpiderMonkey for the synchronised simulation to work (though we might not use the JIT; not sure yet). So we need to be careful about these modes and make sure they're correct before we call into any SpiderMonkey code.
It's hard to know when the mode will be changed (platform default, our init code, SpiderMonkey init code, other code, drivers, etc); probably it would be good to add run-time checks to make sure it sticks with what SpiderMonkey requires. Might need to worry about SSE FTZ/DAZ flags too.
Also need to test it across OSes and 32/64-bit and compilers. And, just to be certain, the game itself should probably run some JS test code on startup to check the results are consistent rather than getting mysterious OOS errors in a network game.