Jit64: Don't flush the regcache on bcx

This commit is contained in:
degasus 2014-06-02 14:32:00 +02:00
parent 0cd9eea99e
commit 541bfd071e

View file

@ -104,17 +104,14 @@ void Jit64::bcx(UGeckoInstruction inst)
// USES_CR // USES_CR
gpr.Flush();
fpr.Flush();
FixupBranch pCTRDontBranch; FixupBranch pCTRDontBranch;
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR
{ {
SUB(32, M(&CTR), Imm8(1)); SUB(32, M(&CTR), Imm8(1));
if (inst.BO & BO_BRANCH_IF_CTR_0) if (inst.BO & BO_BRANCH_IF_CTR_0)
pCTRDontBranch = J_CC(CC_NZ); pCTRDontBranch = J_CC(CC_NZ, true);
else else
pCTRDontBranch = J_CC(CC_Z); pCTRDontBranch = J_CC(CC_Z, true);
} }
FixupBranch pConditionDontBranch; FixupBranch pConditionDontBranch;
@ -122,9 +119,9 @@ void Jit64::bcx(UGeckoInstruction inst)
{ {
TEST(8, M(&PowerPC::ppcState.cr_fast[inst.BI >> 2]), Imm8(8 >> (inst.BI & 3))); TEST(8, M(&PowerPC::ppcState.cr_fast[inst.BI >> 2]), Imm8(8 >> (inst.BI & 3)));
if (inst.BO & BO_BRANCH_IF_TRUE) // Conditional branch if (inst.BO & BO_BRANCH_IF_TRUE) // Conditional branch
pConditionDontBranch = J_CC(CC_Z); pConditionDontBranch = J_CC(CC_Z, true);
else else
pConditionDontBranch = J_CC(CC_NZ); pConditionDontBranch = J_CC(CC_NZ, true);
} }
if (inst.LK) if (inst.LK)
@ -135,6 +132,9 @@ void Jit64::bcx(UGeckoInstruction inst)
destination = SignExt16(inst.BD << 2); destination = SignExt16(inst.BD << 2);
else else
destination = js.compilerPC + SignExt16(inst.BD << 2); destination = js.compilerPC + SignExt16(inst.BD << 2);
gpr.Flush(false);
fpr.Flush(false);
WriteExit(destination); WriteExit(destination);
if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0) if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0)
@ -143,8 +143,12 @@ void Jit64::bcx(UGeckoInstruction inst)
SetJumpTarget( pCTRDontBranch ); SetJumpTarget( pCTRDontBranch );
if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE)) if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE))
{
gpr.Flush();
fpr.Flush();
WriteExit(js.compilerPC + 4); WriteExit(js.compilerPC + 4);
} }
}
void Jit64::bcctrx(UGeckoInstruction inst) void Jit64::bcctrx(UGeckoInstruction inst)
{ {