Skip to content

Commit

Permalink
Fix twi/tw instructions being switched in Jit64 and JitArm; downgrade…
Browse files Browse the repository at this point in the history
… the ERROR_LOG printed when tw is ran in the interpreter to DEBUG
  • Loading branch information
zhuowei committed Sep 7, 2014
1 parent b70c0ae commit e63f7c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ void Interpreter::tw(UGeckoInstruction _inst)
s32 b = m_GPR[_inst.RB];
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)) ||
((a > b) && (TO & 0x08)) ||
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2000,9 +2000,9 @@ void Jit64::twx(UGeckoInstruction inst)
gpr.KillImmediate(a, true, false);

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));
else // tw
CMP(32, gpr.R(a), gpr.R(inst.RB));

std::vector<FixupBranch> fixups;
CCFlags conditions[] = { CC_A, CC_B, CC_E, CC_G, CC_L };
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/PowerPC/JitArm32/JitArm_Integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,12 +915,12 @@ void JitArm::twx(UGeckoInstruction inst)

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
{
MOVI2R(RB, (s32)(s16)inst.SIMM_16);
CMP(gpr.R(a), RB);
CMP(gpr.R(a), gpr.R(inst.RB));
}

FixupBranch al = B_CC(CC_LT);
Expand Down

0 comments on commit e63f7c0

Please sign in to comment.