Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #822 from FioraAeterna/integerflush2
JIT: flush *after* the merged branch, not before
  • Loading branch information
Sonicadvance1 committed Aug 17, 2014
2 parents 66a30d0 + 7527988 commit 7222eb1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
Expand Up @@ -436,17 +436,18 @@ void Jit64::cmpXX(UGeckoInstruction inst)
// std::swap(destination1, destination2), condition = !condition;

gpr.UnlockAll();
gpr.Flush(FLUSH_MAINTAIN_STATE);
fpr.Flush(FLUSH_MAINTAIN_STATE);
FixupBranch pDontBranch;
if (test_bit & 8)
pDontBranch = J_CC(condition ? CC_GE : CC_L); // Test < 0, so jump over if >= 0.
pDontBranch = J_CC(condition ? CC_GE : CC_L, true); // Test < 0, so jump over if >= 0.
else if (test_bit & 4)
pDontBranch = J_CC(condition ? CC_LE : CC_G); // Test > 0, so jump over if <= 0.
pDontBranch = J_CC(condition ? CC_LE : CC_G, true); // Test > 0, so jump over if <= 0.
else if (test_bit & 2)
pDontBranch = J_CC(condition ? CC_NE : CC_E); // Test = 0, so jump over if != 0.
pDontBranch = J_CC(condition ? CC_NE : CC_E, true); // Test = 0, so jump over if != 0.
else // SO bit, do not branch (we don't emulate SO for cmp).
pDontBranch = J();
pDontBranch = J(true);

gpr.Flush(FLUSH_MAINTAIN_STATE);
fpr.Flush(FLUSH_MAINTAIN_STATE);

// Code that handles successful PPC branching.
if (js.next_inst.OPCD == 16) // bcx
Expand Down Expand Up @@ -486,6 +487,8 @@ void Jit64::cmpXX(UGeckoInstruction inst)

if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE))
{
gpr.Flush();
fpr.Flush();
WriteExit(js.next_compilerPC + 4);
}
}
Expand Down

0 comments on commit 7222eb1

Please sign in to comment.