mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-11 00:29:11 +01:00
Merge pull request #2695 from degasus/jit64
Jit64: Fallback support of branching instructions
This commit is contained in:
commit
f800a5b93f
@ -235,7 +235,7 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst)
|
|||||||
{
|
{
|
||||||
gpr.Flush();
|
gpr.Flush();
|
||||||
fpr.Flush();
|
fpr.Flush();
|
||||||
if (js.isLastInstruction)
|
if (js.op->opinfo->flags & FL_ENDBLOCK)
|
||||||
{
|
{
|
||||||
MOV(32, PPCSTATE(pc), Imm32(js.compilerPC));
|
MOV(32, PPCSTATE(pc), Imm32(js.compilerPC));
|
||||||
MOV(32, PPCSTATE(npc), Imm32(js.compilerPC + 4));
|
MOV(32, PPCSTATE(npc), Imm32(js.compilerPC + 4));
|
||||||
@ -244,6 +244,25 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst)
|
|||||||
ABI_PushRegistersAndAdjustStack({}, 0);
|
ABI_PushRegistersAndAdjustStack({}, 0);
|
||||||
ABI_CallFunctionC((void*)instr, inst.hex);
|
ABI_CallFunctionC((void*)instr, inst.hex);
|
||||||
ABI_PopRegistersAndAdjustStack({}, 0);
|
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)
|
void Jit64::HLEFunction(UGeckoInstruction _inst)
|
||||||
|
@ -247,6 +247,4 @@ public:
|
|||||||
|
|
||||||
void lmw(UGeckoInstruction inst);
|
void lmw(UGeckoInstruction inst);
|
||||||
void stmw(UGeckoInstruction inst);
|
void stmw(UGeckoInstruction inst);
|
||||||
|
|
||||||
void icbi(UGeckoInstruction inst);
|
|
||||||
};
|
};
|
||||||
|
@ -300,7 +300,7 @@ static GekkoOPTemplate table31[] =
|
|||||||
|
|
||||||
{4, &Jit64::twX}, // tw
|
{4, &Jit64::twX}, // tw
|
||||||
{598, &Jit64::DoNothing}, // sync
|
{598, &Jit64::DoNothing}, // sync
|
||||||
{982, &Jit64::icbi}, // icbi
|
{982, &Jit64::FallBackToInterpreter}, // icbi
|
||||||
|
|
||||||
// Unused instructions on GC
|
// Unused instructions on GC
|
||||||
{310, &Jit64::FallBackToInterpreter}, // eciwx
|
{310, &Jit64::FallBackToInterpreter}, // eciwx
|
||||||
|
@ -561,9 +561,3 @@ void Jit64::stmw(UGeckoInstruction inst)
|
|||||||
}
|
}
|
||||||
gpr.UnlockAllX();
|
gpr.UnlockAllX();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit64::icbi(UGeckoInstruction inst)
|
|
||||||
{
|
|
||||||
FallBackToInterpreter(inst);
|
|
||||||
WriteExit(js.compilerPC + 4);
|
|
||||||
}
|
|
||||||
|
@ -348,8 +348,7 @@ void Jit64::mfspr(UGeckoInstruction inst)
|
|||||||
void Jit64::mtmsr(UGeckoInstruction inst)
|
void Jit64::mtmsr(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
// Don't interpret this, if we do we get thrown out
|
JITDISABLE(bJITSystemRegistersOff);
|
||||||
//JITDISABLE(bJITSystemRegistersOff);
|
|
||||||
if (!gpr.R(inst.RS).IsImm())
|
if (!gpr.R(inst.RS).IsImm())
|
||||||
{
|
{
|
||||||
gpr.Lock(inst.RS);
|
gpr.Lock(inst.RS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user