mirror of
https://github.com/ptitSeb/box64.git
synced 2026-11-09 17:43:18 -10:00
The interpreter implements a number of SSE and AVX instructions using host floating-point operations, but did not apply the guest MXCSR.RC before performing them. As a result, directed rounding modes could produce results using the host's previous rounding mode. Add mxcsr_setround() to save the host rounding mode and temporarily apply the rounding mode selected by the guest MXCSR. Use it around the affected SSE and AVX arithmetic, horizontal, dot-product, conversion, and FMA interpreter paths, restoring the original host mode afterward. Add an interpreter regression test covering all four MXCSR rounding modes and representative scalar, packed, conversion, AVX, and FMA instructions. Force the test through the interpreter so that a dynarec path cannot hide interpreter rounding errors. Signed-off-by: Zewei Yang <[email protected]>
28 KiB
Executable File
28 KiB
Executable File