From da63cee711de321d4f5eab1bb4f0e58493202398 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 16 Oct 2021 15:56:50 +0200 Subject: [PATCH] PPCAnalyst: More strict a_flags checks in CanSwapAdjacentOps If for instance instruction a sets OE and instruction b reads it, we shouldn't permit reordering. --- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 2dd988d6c2..1ea5f7dd3e 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -222,7 +222,7 @@ bool PPCAnalyzer::CanSwapAdjacentOps(const CodeOp& a, const CodeOp& b) const // [1] https://bugs.dolphin-emu.org/issues/5864#note-7 if (a.canCauseException || b.canCauseException) return false; - if (a_flags & FL_ENDBLOCK) + if (a_flags & (FL_ENDBLOCK | FL_TIMER | FL_EVIL | FL_SET_OE)) return false; if (b_flags & (FL_SET_CRx | FL_ENDBLOCK | FL_TIMER | FL_EVIL | FL_SET_OE)) return false;