From 86fd84870a994d6f9a6a630a07fcf1b840c5705b Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Sat, 21 Mar 2026 00:52:31 +0900 Subject: [PATCH] [Testing] reset guest rounding mode before each test run prevents a dirty FPU rounding mode from leaking between test cases --- src/xenia/cpu/testing/util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xenia/cpu/testing/util.h b/src/xenia/cpu/testing/util.h index 96ecf638b..08a075709 100644 --- a/src/xenia/cpu/testing/util.h +++ b/src/xenia/cpu/testing/util.h @@ -77,6 +77,10 @@ class TestFunction { auto ctx = thread_state->context(); ctx->lr = 0xBCBCBCBC; + // Reset hardware FPU rounding mode to nearest before each run, + // in case a prior test left it dirty. + processor->backend()->SetGuestRoundingMode(ctx, 0); + pre_call(ctx); fn->Call(thread_state.get(), uint32_t(ctx->lr));