diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 52008c3f6b..6f1b087854 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -26,6 +26,7 @@ void JitArm64::Init() code_block.m_gpa = &js.gpa; code_block.m_fpa = &js.fpa; InitBackpatch(); + analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE); } void JitArm64::ClearCache() diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp index 037e995718..849d20f403 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp @@ -116,9 +116,6 @@ void JitArm64::bcx(UGeckoInstruction inst) { INSTRUCTION_START - gpr.Flush(FlushMode::FLUSH_ALL); - fpr.Flush(FlushMode::FLUSH_ALL); - ARM64Reg WA = gpr.GetReg(); FixupBranch pCTRDontBranch; if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR @@ -154,6 +151,10 @@ void JitArm64::bcx(UGeckoInstruction inst) destination = SignExt16(inst.BD << 2); else destination = js.compilerPC + SignExt16(inst.BD << 2); + + gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); + fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); + WriteExit(destination); if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0) @@ -161,7 +162,12 @@ void JitArm64::bcx(UGeckoInstruction inst) if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) SetJumpTarget( pCTRDontBranch ); - WriteExit(js.compilerPC + 4); + if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE)) + { + gpr.Flush(FlushMode::FLUSH_ALL); + fpr.Flush(FlushMode::FLUSH_ALL); + WriteExit(js.compilerPC + 4); + } } void JitArm64::bcctrx(UGeckoInstruction inst) @@ -207,9 +213,6 @@ void JitArm64::bclrx(UGeckoInstruction inst) { INSTRUCTION_START - gpr.Flush(FlushMode::FLUSH_ALL); - fpr.Flush(FlushMode::FLUSH_ALL); - ARM64Reg WA = gpr.GetReg(); FixupBranch pCTRDontBranch; if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR @@ -243,6 +246,9 @@ void JitArm64::bclrx(UGeckoInstruction inst) gpr.Unlock(WB); } + gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); + fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); + WriteExitDestInR(WA); if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0) @@ -250,5 +256,10 @@ void JitArm64::bclrx(UGeckoInstruction inst) if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) SetJumpTarget( pCTRDontBranch ); - WriteExit(js.compilerPC + 4); + if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE)) + { + gpr.Flush(FlushMode::FLUSH_ALL); + fpr.Flush(FlushMode::FLUSH_ALL); + WriteExit(js.compilerPC + 4); + } } diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp index 800c58044a..ea6ea6c46a 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp @@ -135,9 +135,6 @@ void JitArm64::twx(UGeckoInstruction inst) INSTRUCTION_START JITDISABLE(bJITIntegerOff); - gpr.Flush(FlushMode::FLUSH_ALL); - fpr.Flush(FlushMode::FLUSH_ALL); - s32 a = inst.RA; ARM64Reg WA = gpr.GetReg(); @@ -178,6 +175,9 @@ void JitArm64::twx(UGeckoInstruction inst) SetJumpTarget(fixup); } + gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); + fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE); + LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(Exceptions)); ORR(WA, WA, 24, 0); // Same as WA | EXCEPTION_PROGRAM STR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(Exceptions)); @@ -189,5 +189,10 @@ void JitArm64::twx(UGeckoInstruction inst) SetJumpTarget(dont_trap); - WriteExit(js.compilerPC + 4); + if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE)) + { + gpr.Flush(FlushMode::FLUSH_ALL); + fpr.Flush(FlushMode::FLUSH_ALL); + WriteExit(js.compilerPC + 4); + } }