mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #1727 from Sonicadvance1/AArch64_conditional_continue
[AArch64] Adds support for conditional continue.
This commit is contained in:
@ -26,6 +26,7 @@ void JitArm64::Init()
|
|||||||
code_block.m_gpa = &js.gpa;
|
code_block.m_gpa = &js.gpa;
|
||||||
code_block.m_fpa = &js.fpa;
|
code_block.m_fpa = &js.fpa;
|
||||||
InitBackpatch();
|
InitBackpatch();
|
||||||
|
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitArm64::ClearCache()
|
void JitArm64::ClearCache()
|
||||||
|
@ -116,9 +116,6 @@ void JitArm64::bcx(UGeckoInstruction inst)
|
|||||||
{
|
{
|
||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
|
|
||||||
gpr.Flush(FlushMode::FLUSH_ALL);
|
|
||||||
fpr.Flush(FlushMode::FLUSH_ALL);
|
|
||||||
|
|
||||||
ARM64Reg WA = gpr.GetReg();
|
ARM64Reg WA = gpr.GetReg();
|
||||||
FixupBranch pCTRDontBranch;
|
FixupBranch pCTRDontBranch;
|
||||||
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR
|
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);
|
destination = SignExt16(inst.BD << 2);
|
||||||
else
|
else
|
||||||
destination = js.compilerPC + SignExt16(inst.BD << 2);
|
destination = js.compilerPC + SignExt16(inst.BD << 2);
|
||||||
|
|
||||||
|
gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
|
||||||
|
fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
|
||||||
|
|
||||||
WriteExit(destination);
|
WriteExit(destination);
|
||||||
|
|
||||||
if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0)
|
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)
|
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0)
|
||||||
SetJumpTarget( pCTRDontBranch );
|
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)
|
void JitArm64::bcctrx(UGeckoInstruction inst)
|
||||||
@ -207,9 +213,6 @@ void JitArm64::bclrx(UGeckoInstruction inst)
|
|||||||
{
|
{
|
||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
|
|
||||||
gpr.Flush(FlushMode::FLUSH_ALL);
|
|
||||||
fpr.Flush(FlushMode::FLUSH_ALL);
|
|
||||||
|
|
||||||
ARM64Reg WA = gpr.GetReg();
|
ARM64Reg WA = gpr.GetReg();
|
||||||
FixupBranch pCTRDontBranch;
|
FixupBranch pCTRDontBranch;
|
||||||
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR
|
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.Unlock(WB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
|
||||||
|
fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
|
||||||
|
|
||||||
WriteExitDestInR(WA);
|
WriteExitDestInR(WA);
|
||||||
|
|
||||||
if ((inst.BO & BO_DONT_CHECK_CONDITION) == 0)
|
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)
|
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0)
|
||||||
SetJumpTarget( pCTRDontBranch );
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,9 +135,6 @@ void JitArm64::twx(UGeckoInstruction inst)
|
|||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
JITDISABLE(bJITIntegerOff);
|
JITDISABLE(bJITIntegerOff);
|
||||||
|
|
||||||
gpr.Flush(FlushMode::FLUSH_ALL);
|
|
||||||
fpr.Flush(FlushMode::FLUSH_ALL);
|
|
||||||
|
|
||||||
s32 a = inst.RA;
|
s32 a = inst.RA;
|
||||||
|
|
||||||
ARM64Reg WA = gpr.GetReg();
|
ARM64Reg WA = gpr.GetReg();
|
||||||
@ -178,6 +175,9 @@ void JitArm64::twx(UGeckoInstruction inst)
|
|||||||
SetJumpTarget(fixup);
|
SetJumpTarget(fixup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
|
||||||
|
fpr.Flush(FlushMode::FLUSH_MAINTAIN_STATE);
|
||||||
|
|
||||||
LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(Exceptions));
|
LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(Exceptions));
|
||||||
ORR(WA, WA, 24, 0); // Same as WA | EXCEPTION_PROGRAM
|
ORR(WA, WA, 24, 0); // Same as WA | EXCEPTION_PROGRAM
|
||||||
STR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(Exceptions));
|
STR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(Exceptions));
|
||||||
@ -189,5 +189,10 @@ void JitArm64::twx(UGeckoInstruction inst)
|
|||||||
|
|
||||||
SetJumpTarget(dont_trap);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user