yzewei
3f34d1e7e6
[INTERP] Honor MXCSR rounding mode in SSE/AVX operations ( #4408 )
...
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] >
2026-09-21 09:09:47 +08:00
..
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2024-10-18 14:53:13 +02:00
2026-09-21 09:09:47 +08:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-02-28 13:19:23 +01:00
2021-03-08 18:34:07 +01:00
2024-12-02 17:01:08 +01:00
2024-02-14 09:14:01 +01:00
2025-04-25 20:03:58 +02:00
2022-09-30 19:13:47 +02:00
2022-02-14 13:13:12 +01:00
2022-07-03 14:14:17 +02:00
2024-12-03 12:54:54 +01:00
2025-12-14 14:13:13 +01:00
2024-02-14 09:14:01 +01:00
2025-01-08 14:43:14 +01:00
2023-09-04 09:29:55 +02:00
2023-09-24 22:20:21 +02:00
2023-10-14 18:49:30 +02:00
2023-10-25 14:14:11 +02:00
2024-04-28 22:16:29 +02:00
2023-11-21 18:00:58 +01:00
2023-12-03 18:26:11 +01:00
2025-04-25 20:03:58 +02:00
2025-01-08 15:34:15 +01:00
2025-04-22 13:31:04 +02:00
2025-12-16 12:11:21 +01:00
2026-06-23 19:06:34 +02:00
2026-06-23 19:06:34 +02:00
2026-09-21 09:09:47 +08:00
2026-08-31 19:50:21 +02:00
2024-02-15 18:11:57 +01:00
2024-02-14 09:14:01 +01:00
2026-03-06 17:59:18 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-04-13 20:00:56 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2022-03-31 11:01:15 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2026-07-24 20:51:14 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2026-08-31 19:50:21 +02:00
2021-02-28 13:19:23 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2021-03-08 18:34:07 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2024-12-02 17:01:08 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2025-04-25 20:03:58 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2022-09-30 19:13:47 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-02-18 08:44:54 +01:00
2026-08-31 19:50:21 +02:00
2022-07-03 14:14:17 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2025-12-14 14:13:13 +01:00
2024-12-03 12:54:54 +01:00
2026-08-31 19:50:21 +02:00
2024-12-04 18:27:24 +01:00
2026-08-31 19:50:21 +02:00
2026-08-31 19:50:21 +02:00
2025-01-08 14:43:14 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-09-04 09:29:55 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-09-24 22:20:21 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-10-14 18:49:30 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-10-25 14:14:11 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2024-04-28 22:16:29 +02:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-11-21 18:00:58 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2023-12-03 18:26:11 +01:00
2024-02-14 09:14:01 +01:00
2026-08-31 19:50:21 +02:00
2025-04-25 20:03:58 +02:00
2026-08-31 19:50:21 +02:00
2025-01-08 15:34:15 +01:00
2026-08-31 19:50:21 +02:00
2025-04-22 13:31:04 +02:00
2026-08-31 19:50:21 +02:00
2025-12-16 12:11:21 +01:00
2026-08-31 19:50:21 +02:00
2026-06-23 19:06:34 +02:00
2026-06-23 19:06:34 +02:00
2026-08-31 19:50:21 +02:00
2026-06-23 19:06:34 +02:00
2026-08-31 19:50:21 +02:00
2026-09-21 09:09:47 +08:00
2026-09-21 09:09:47 +08:00