summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2021-06-29 15:54:50 +0200
committerJosJuice <josjuice@gmail.com>2022-01-01 20:25:04 +0100
commitab8b2f9fe04af657ff9b75e9ab65af5722cd4d37 (patch)
tree9aa21e44429aa4522c164499eeaa98f117ac964f /Source/Core
parent85d2ea0dd28444effed13a622360253f2d74bcba (diff)
PPCAnalyst: Less strict interrupt checks in CanSwapAdjacentOps
When these checks were originally added, we didn't have the nice canCauseException attribute. Now we do, so let's use it.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/PPCAnalyst.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp
index 9b70f5434e..47a7db2638 100644
--- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp
+++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp
@@ -205,6 +205,14 @@ bool PPCAnalyzer::CanSwapAdjacentOps(const CodeOp& a, const CodeOp& b) const
{
return false;
}
+ // Any instruction which can raise an interrupt is *not* a possible swap candidate:
+ // see [1] for an example of a crash caused by this error.
+ //
+ // [1] https://bugs.dolphin-emu.org/issues/5864#note-7
+ if (a.canCauseException || b.canCauseException)
+ return false;
+ if (a_flags & FL_ENDBLOCK)
+ return false;
if (b_flags & (FL_SET_CRx | FL_ENDBLOCK | FL_TIMER | FL_EVIL | FL_SET_OE))
return false;
if ((b_flags & (FL_RC_BIT | FL_RC_BIT_F)) && (b.inst.Rc))
@@ -223,18 +231,10 @@ bool PPCAnalyzer::CanSwapAdjacentOps(const CodeOp& a, const CodeOp& b) const
return false;
}
- // For now, only integer ops acceptable. Any instruction which can raise an
- // interrupt is *not* a possible swap candidate: see [1] for an example of
- // a crash caused by this error.
- //
- // [1] https://bugs.dolphin-emu.org/issues/5864#note-7
+ // For now, only integer ops are acceptable.
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.