View Single Post
Old 10 December 2015, 20:09   #13
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,512
It was side-effect of Visual Studio "feature".

32-bit FPU rounding mode function changes both FPU and SSE2 rounding mode.

64-bit version only changes SSE2 rounding mode. (Apparently because x87-like FPU is considered legacy feature and use of SSE2 is the way to do it in 64-bit Windows because all x64 CPUs have it). There is no function to set FPU rounding mode..

320b16 introduced code (by Frode) that sets FPU rounding mode that works in both 32-bit and 64-bit, to allow 64-bit version to work correctly with JIT because it uses x87 FPU instructions.

SSE2 unit rounding mode was not anymore updated and so far everything appeared to work but some function used SSE2 instead of FPU (compiler decided SSE2 is better than x87 FPU instruction): unexpected rounding mode was used in some situations and this demo didn't like it at all.

Fixed version always sets both, x87 FPU and SSE2 rounding mode.

UAE maps 68k FPU instructions to host FPU instructions for performance reasons. Some emulators use softfloat library for accuracy, especially exceptions can only work correctly if using softfloat, fortunately practically no one uses FPU exceptions.
Toni Wilen is offline  
Page generated in 0.03892 seconds with 10 queries