Merge pull request #2695 from degasus/jit64

Jit64: Fallback support of branching instructions
This commit is contained in:
Markus Wick 2015-07-28 16:37:41 +02:00
commit f800a5b93f
5 changed files with 22 additions and 12 deletions

View File

@ -235,7 +235,7 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst)
{
gpr.Flush();
fpr.Flush();
if (js.isLastInstruction)
if (js.op->opinfo->flags & FL_ENDBLOCK)
{
MOV(32, PPCSTATE(pc), Imm32(js.compilerPC));
MOV(32, PPCSTATE(npc), Imm32(js.compilerPC + 4));
@ -244,6 +244,25 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst)
ABI_PushRegistersAndAdjustStack({}, 0);
ABI_CallFunctionC((void*)instr, inst.hex);
ABI_PopRegistersAndAdjustStack({}, 0);
if (js.op->opinfo->flags & FL_ENDBLOCK)
{
if (js.isLastInstruction)
{
MOV(32, R(RSCRATCH), PPCSTATE(npc));
MOV(32, PPCSTATE(pc), R(RSCRATCH));
WriteExceptionExit();
}
else
{
MOV(32, R(RSCRATCH), PPCSTATE(npc));
SUB(32, R(RSCRATCH), Imm32(js.compilerPC + 4));
FixupBranch c = J_CC(CC_Z);
MOV(32, R(RSCRATCH), PPCSTATE(npc));
MOV(32, PPCSTATE(pc), R(RSCRATCH));
WriteExceptionExit();
SetJumpTarget(c);
}
}
}
void Jit64::HLEFunction(UGeckoInstruction _inst)

View File

@ -247,6 +247,4 @@ public:
void lmw(UGeckoInstruction inst);
void stmw(UGeckoInstruction inst);
void icbi(UGeckoInstruction inst);
};

View File

@ -300,7 +300,7 @@ static GekkoOPTemplate table31[] =
{4, &Jit64::twX}, // tw
{598, &Jit64::DoNothing}, // sync
{982, &Jit64::icbi}, // icbi
{982, &Jit64::FallBackToInterpreter}, // icbi
// Unused instructions on GC
{310, &Jit64::FallBackToInterpreter}, // eciwx

View File

@ -561,9 +561,3 @@ void Jit64::stmw(UGeckoInstruction inst)
}
gpr.UnlockAllX();
}
void Jit64::icbi(UGeckoInstruction inst)
{
FallBackToInterpreter(inst);
WriteExit(js.compilerPC + 4);
}

View File

@ -348,8 +348,7 @@ void Jit64::mfspr(UGeckoInstruction inst)
void Jit64::mtmsr(UGeckoInstruction inst)
{
INSTRUCTION_START
// Don't interpret this, if we do we get thrown out
//JITDISABLE(bJITSystemRegistersOff);
JITDISABLE(bJITSystemRegistersOff);
if (!gpr.R(inst.RS).IsImm())
{
gpr.Lock(inst.RS);