Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JitArm64: Implement dcbt #2845

Merged
merged 1 commit into from
Aug 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Core/Core/PowerPC/JitArm64/Jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class JitArm64 : public JitBase, public Arm64Gen::ARM64CodeBlock
void stX(UGeckoInstruction inst);
void lmw(UGeckoInstruction inst);
void stmw(UGeckoInstruction inst);
void dcbt(UGeckoInstruction inst);

// LoadStore floating point
void lfXX(UGeckoInstruction inst);
Expand Down
20 changes: 20 additions & 0 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down