From a31ebb9bcd8365e19a1003032b8ed1ed30c7ed55 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Tue, 7 Jul 2015 22:11:21 +1200 Subject: [PATCH] PPCAnalyst: Don't swap instruction which might cause interrupts. fcmpo and fcmpu can be matched by the REORDER_CMP pass, as they set CR0 and they can cause interrupts if the fpu is disabled. So we add an extra check to make sure op a is an integer op too. --- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index cdd7fcc19b..f08b0f4216 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -250,6 +250,10 @@ static bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b) if (b_info->type != OPTYPE_INTEGER) return false; + // And it's possible a might raise an interrupt too (fcmpo/fcmpu) + if (a_info->type != OPTYPE_INTEGER) + return false; + // Check that we have no register collisions. // That is, check that none of b's outputs matches any of a's inputs, // and that none of a's outputs matches any of b's inputs.