JitArm64: Move all FLUSH_MAINTAIN_STATE to the far cache

This commit is contained in:
degasus 2015-07-11 12:30:05 +02:00
parent b8dd68beef
commit 7196901b40
4 changed files with 30 additions and 0 deletions

View File

@ -401,6 +401,10 @@ const u8* JitArm64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitB
LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(msr)); LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(msr));
FixupBranch b1 = TBNZ(WA, 13); // Test FP enabled bit FixupBranch b1 = TBNZ(WA, 13); // Test FP enabled bit
FixupBranch far = B();
SwitchToFarCode();
SetJumpTarget(far);
gpr.Flush(FLUSH_MAINTAIN_STATE); gpr.Flush(FLUSH_MAINTAIN_STATE);
fpr.Flush(FLUSH_MAINTAIN_STATE); fpr.Flush(FLUSH_MAINTAIN_STATE);
@ -411,6 +415,8 @@ const u8* JitArm64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitB
MOVI2R(WA, js.compilerPC); MOVI2R(WA, js.compilerPC);
WriteExceptionExit(WA); WriteExceptionExit(WA);
SwitchToNearCode();
SetJumpTarget(b1); SetJumpTarget(b1);
js.firstFPInstructionFound = true; js.firstFPInstructionFound = true;

View File

@ -142,6 +142,10 @@ void JitArm64::bcx(UGeckoInstruction inst)
!(inst.BO_2 & BO_BRANCH_IF_TRUE)); !(inst.BO_2 & BO_BRANCH_IF_TRUE));
} }
FixupBranch far = B();
SwitchToFarCode();
SetJumpTarget(far);
if (inst.LK) if (inst.LK)
{ {
u32 Jumpto = js.compilerPC + 4; u32 Jumpto = js.compilerPC + 4;
@ -161,6 +165,8 @@ void JitArm64::bcx(UGeckoInstruction inst)
WriteExit(destination); WriteExit(destination);
SwitchToNearCode();
if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0) if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0)
SetJumpTarget( pConditionDontBranch ); SetJumpTarget( pConditionDontBranch );
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0)
@ -235,6 +241,10 @@ void JitArm64::bclrx(UGeckoInstruction inst)
!(inst.BO_2 & BO_BRANCH_IF_TRUE)); !(inst.BO_2 & BO_BRANCH_IF_TRUE));
} }
FixupBranch far = B();
SwitchToFarCode();
SetJumpTarget(far);
LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(spr[SPR_LR])); LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(spr[SPR_LR]));
AND(WA, WA, 30, 29); // Wipe the bottom 2 bits. AND(WA, WA, 30, 29); // Wipe the bottom 2 bits.
@ -252,6 +262,8 @@ void JitArm64::bclrx(UGeckoInstruction inst)
WriteExitDestInR(WA); WriteExitDestInR(WA);
SwitchToNearCode();
if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0) if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0)
SetJumpTarget( pConditionDontBranch ); SetJumpTarget( pConditionDontBranch );
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0)

View File

@ -411,6 +411,10 @@ void JitArm64::lXX(UGeckoInstruction inst)
// if it's still 0, we can wait until the next event // if it's still 0, we can wait until the next event
FixupBranch noIdle = CBNZ(gpr.R(d)); FixupBranch noIdle = CBNZ(gpr.R(d));
FixupBranch far = B();
SwitchToFarCode();
SetJumpTarget(far);
gpr.Flush(FLUSH_MAINTAIN_STATE); gpr.Flush(FLUSH_MAINTAIN_STATE);
fpr.Flush(FLUSH_MAINTAIN_STATE); fpr.Flush(FLUSH_MAINTAIN_STATE);
@ -423,6 +427,8 @@ void JitArm64::lXX(UGeckoInstruction inst)
gpr.Unlock(WA); gpr.Unlock(WA);
WriteExceptionExit(); WriteExceptionExit();
SwitchToNearCode();
SetJumpTarget(noIdle); SetJumpTarget(noIdle);
//js.compilerPC += 8; //js.compilerPC += 8;

View File

@ -184,6 +184,10 @@ void JitArm64::twx(UGeckoInstruction inst)
SetJumpTarget(fixup); SetJumpTarget(fixup);
} }
FixupBranch far = B();
SwitchToFarCode();
SetJumpTarget(far);
gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
@ -196,6 +200,8 @@ void JitArm64::twx(UGeckoInstruction inst)
// WA is unlocked in this function // WA is unlocked in this function
WriteExceptionExit(WA); WriteExceptionExit(WA);
SwitchToNearCode();
SetJumpTarget(dont_trap); SetJumpTarget(dont_trap);
if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE)) if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE))