JitArm64: Implement dcbt

This is a 1:1 copy&paste from Jit64.
This commit is contained in:
degasus 2015-08-13 23:21:38 +02:00
parent c306095684
commit fc23380f6b
3 changed files with 23 additions and 2 deletions

View File

@ -127,6 +127,7 @@ public:
void stX(UGeckoInstruction inst);
void lmw(UGeckoInstruction inst);
void stmw(UGeckoInstruction inst);
void dcbt(UGeckoInstruction inst);
// LoadStore floating point
void lfXX(UGeckoInstruction inst);

View File

@ -623,3 +623,23 @@ void JitArm64::stmw(UGeckoInstruction inst)
gpr.Unlock(WA, WB);
}
void JitArm64::dcbt(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITLoadStoreOff);
// Prefetch. Since we don't emulate the data cache, we don't need to do anything.
// If a dcbst follows a dcbt, it probably isn't a case of dynamic code
// modification, so don't bother invalidating the jit block cache.
// This is important because invalidating the block cache when we don't
// need to is terrible for performance.
// (Invalidating the jit block cache on dcbst is a heuristic.)
if (MergeAllowedNextInstructions(1) &&
js.op[1].inst.OPCD == 31 && js.op[1].inst.SUBOP10 == 54 &&
js.op[1].inst.RA == inst.RA && js.op[1].inst.RB == inst.RB)
{
js.skipInstructions = 1;
}
}

View File

@ -222,8 +222,8 @@ static GekkoOPTemplate table31[] =
{54, &JitArm64::FallBackToInterpreter}, // dcbst
{86, &JitArm64::FallBackToInterpreter}, // dcbf
{246, &JitArm64::DoNothing}, // dcbtst
{278, &JitArm64::DoNothing}, // dcbt
{246, &JitArm64::dcbt}, // dcbtst
{278, &JitArm64::dcbt}, // dcbt
{470, &JitArm64::FallBackToInterpreter}, // dcbi
{758, &JitArm64::DoNothing}, // dcba
{1014, &JitArm64::FallBackToInterpreter}, // dcbz