This commit is contained in:
Martino Fontana 2026-07-01 22:24:34 -04:00 committed by GitHub
commit 462f356bab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 17 deletions

View File

@ -182,23 +182,14 @@ void Jit64::ComputeRC(preg_t preg, bool needs_test, bool needs_sext)
if (CheckMergedBranch(0))
{
// If the output operand to the cmp/rc op we're merging with the branch isn't used anymore, it'd
// be better to flush it here so that we don't have to flush it on both sides of the branch.
// The flush is before the TEST so that it can macro-op fusion with the conditional branch.
gpr.Flush(~js.op->gprWillBeWritten & js.op->regsOut, RegCache::FlushMode::Undirty);
if (needs_test)
{
TEST(32, arg, arg);
arg.Unlock();
}
else
{
// If an operand to the cmp/rc op we're merging with the branch isn't used anymore, it'd be
// better to flush it here so that we don't have to flush it on both sides of the branch.
// We don't want to do this if a test is needed though, because it would interrupt macro-op
// fusion.
arg.Unlock();
gpr.Flush(~(js.op->gprWillBeRead | js.op->gprWillBeWritten) &
(js.op->regsIn | js.op->regsOut),
RegCache::FlushMode::Full);
gpr.Flush(~js.op->gprWillBeWritten & js.op->regsOut, RegCache::FlushMode::Undirty);
}
arg.Unlock();
DoMergedBranchCondition();
}
}

View File

@ -338,8 +338,8 @@ void RegCache::Flush(BitSet32 pregs, FlushMode mode,
for (preg_t i : pregs)
{
ASSERT_MSG(DYNA_REC, !m_regs[i].IsLocked(), "Someone forgot to unlock PPC reg {} (X64 reg {}).",
i, std::to_underlying(RX(i)));
ASSERT_MSG(DYNA_REC, mode != FlushMode::Full || !m_regs[i].IsLocked(),
"Someone forgot to unlock PPC reg {} (X64 reg {}).", i, std::to_underlying(RX(i)));
ASSERT_MSG(DYNA_REC, !m_regs[i].IsRevertable(), "Register transaction is in progress for {}!",
i);