Merge pull request #1017 from zhuowei/tw_fallback_if_constant_ra
Fix various issues with the twi/tw instructions
This commit is contained in:
commit
e8d8713e03
|
@ -413,7 +413,7 @@ void Interpreter::tw(UGeckoInstruction _inst)
|
||||||
s32 b = m_GPR[_inst.RB];
|
s32 b = m_GPR[_inst.RB];
|
||||||
s32 TO = _inst.TO;
|
s32 TO = _inst.TO;
|
||||||
|
|
||||||
ERROR_LOG(POWERPC, "tw rA %0x rB %0x TO %0x", a, b, TO);
|
DEBUG_LOG(POWERPC, "tw rA %0x rB %0x TO %0x", a, b, TO);
|
||||||
|
|
||||||
if (((a < b) && (TO & 0x10)) ||
|
if (((a < b) && (TO & 0x10)) ||
|
||||||
((a > b) && (TO & 0x08)) ||
|
((a > b) && (TO & 0x08)) ||
|
||||||
|
|
|
@ -1999,10 +1999,12 @@ void Jit64::twx(UGeckoInstruction inst)
|
||||||
|
|
||||||
s32 a = inst.RA;
|
s32 a = inst.RA;
|
||||||
|
|
||||||
|
gpr.KillImmediate(a, true, false);
|
||||||
|
|
||||||
if (inst.OPCD == 3) // twi
|
if (inst.OPCD == 3) // twi
|
||||||
CMP(32, gpr.R(a), gpr.R(inst.RB));
|
|
||||||
else // tw
|
|
||||||
CMP(32, gpr.R(a), Imm32((s32)(s16)inst.SIMM_16));
|
CMP(32, gpr.R(a), Imm32((s32)(s16)inst.SIMM_16));
|
||||||
|
else // tw
|
||||||
|
CMP(32, gpr.R(a), gpr.R(inst.RB));
|
||||||
|
|
||||||
std::vector<FixupBranch> fixups;
|
std::vector<FixupBranch> fixups;
|
||||||
CCFlags conditions[] = { CC_A, CC_B, CC_E, CC_G, CC_L };
|
CCFlags conditions[] = { CC_A, CC_B, CC_E, CC_G, CC_L };
|
||||||
|
|
|
@ -915,12 +915,12 @@ void JitArm::twx(UGeckoInstruction inst)
|
||||||
|
|
||||||
if (inst.OPCD == 3) // twi
|
if (inst.OPCD == 3) // twi
|
||||||
{
|
{
|
||||||
CMP(gpr.R(a), gpr.R(inst.RB));
|
MOVI2R(RB, (s32)(s16)inst.SIMM_16);
|
||||||
|
CMP(gpr.R(a), RB);
|
||||||
}
|
}
|
||||||
else // tw
|
else // tw
|
||||||
{
|
{
|
||||||
MOVI2R(RB, (s32)(s16)inst.SIMM_16);
|
CMP(gpr.R(a), gpr.R(inst.RB));
|
||||||
CMP(gpr.R(a), RB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FixupBranch al = B_CC(CC_LT);
|
FixupBranch al = B_CC(CC_LT);
|
||||||
|
|
Loading…
Reference in New Issue