Merge pull request #487 from Sonicadvance1/Fix-Conditional-branch
Fix conditional branching on x86_64.
This commit is contained in:
commit
679f57eb1f
|
@ -186,7 +186,7 @@ void Jit64::bcctrx(UGeckoInstruction inst)
|
||||||
branch = CC_Z;
|
branch = CC_Z;
|
||||||
else
|
else
|
||||||
branch = CC_NZ;
|
branch = CC_NZ;
|
||||||
FixupBranch b = J_CC(branch, false);
|
FixupBranch b = J_CC(branch, true);
|
||||||
MOV(32, R(EAX), M(&CTR));
|
MOV(32, R(EAX), M(&CTR));
|
||||||
AND(32, R(EAX), Imm32(0xFFFFFFFC));
|
AND(32, R(EAX), Imm32(0xFFFFFFFC));
|
||||||
//MOV(32, M(&PC), R(EAX)); => Already done in WriteExitDestInEAX()
|
//MOV(32, M(&PC), R(EAX)); => Already done in WriteExitDestInEAX()
|
||||||
|
@ -214,9 +214,9 @@ void Jit64::bclrx(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
@ -224,9 +224,9 @@ void Jit64::bclrx(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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This below line can be used to prove that blr "eats flags" in practice.
|
// This below line can be used to prove that blr "eats flags" in practice.
|
||||||
|
|
|
@ -2194,7 +2194,7 @@ void Jit64::twx(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
if (inst.TO & (1 << i))
|
if (inst.TO & (1 << i))
|
||||||
{
|
{
|
||||||
FixupBranch f = J_CC(conditions[i]);
|
FixupBranch f = J_CC(conditions[i], true);
|
||||||
fixups.push_back(f);
|
fixups.push_back(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue