mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
JIT: this should remove bclrx from TD's profiles...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3861 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -263,15 +263,15 @@ void Jit64::bcctrx(UGeckoInstruction inst)
|
|||||||
|
|
||||||
void Jit64::bclrx(UGeckoInstruction inst)
|
void Jit64::bclrx(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITBranchOff)
|
if (Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITBranchOff)
|
||||||
{Default(inst); return;} // turn off from debugger
|
{Default(inst); return;} // turn off from debugger
|
||||||
|
|
||||||
INSTRUCTION_START;
|
INSTRUCTION_START;
|
||||||
|
|
||||||
gpr.Flush(FLUSH_ALL);
|
gpr.Flush(FLUSH_ALL);
|
||||||
fpr.Flush(FLUSH_ALL);
|
fpr.Flush(FLUSH_ALL);
|
||||||
//Special case BLR
|
//Special case BLR & BLRL
|
||||||
if (inst.hex == 0x4e800020)
|
if ((inst.hex & ~1) == 0x4e800020)
|
||||||
{
|
{
|
||||||
//CDynaRegCache::Flush();
|
//CDynaRegCache::Flush();
|
||||||
// This below line can be used to prove that blr "eats flags" in practice.
|
// This below line can be used to prove that blr "eats flags" in practice.
|
||||||
@ -281,6 +281,33 @@ void Jit64::bclrx(UGeckoInstruction inst)
|
|||||||
#endif
|
#endif
|
||||||
MOV(32, R(EAX), M(&LR));
|
MOV(32, R(EAX), M(&LR));
|
||||||
MOV(32, M(&PC), R(EAX));
|
MOV(32, M(&PC), R(EAX));
|
||||||
|
if (inst.LK)
|
||||||
|
MOV(32, M(&LR), Imm32(js.compilerPC + 4)); // LR = PC + 4;
|
||||||
|
WriteExitDestInEAX(0);
|
||||||
|
return;
|
||||||
|
} else if ((inst.BO & 4) == 0) {
|
||||||
|
// Decrement CTR?? in bclrx?? this goes to fallback.
|
||||||
|
} else if ((inst.BO & 16) == 0) {
|
||||||
|
// Test a CR bit. Not too hard.
|
||||||
|
// beqlr- 4d820020
|
||||||
|
// blelr- 4c810020
|
||||||
|
// blrl 4e800021
|
||||||
|
// bnelr 4c820020
|
||||||
|
// etc...
|
||||||
|
TEST(8, M(&PowerPC::ppcState.cr_fast[inst.BI >> 2]), Imm8(8 >> (inst.BI & 3)));
|
||||||
|
Gen::CCFlags branch;
|
||||||
|
if (inst.BO & 8)
|
||||||
|
branch = CC_Z;
|
||||||
|
else
|
||||||
|
branch = CC_NZ;
|
||||||
|
MOV(32, R(EAX), Imm32(js.compilerPC + 4));
|
||||||
|
FixupBranch b = J_CC(branch, false);
|
||||||
|
MOV(32, R(EAX), M(&LR));
|
||||||
|
MOV(32, M(&PC), R(EAX));
|
||||||
|
if (inst.LK)
|
||||||
|
MOV(32, M(&LR), Imm32(js.compilerPC + 4)); // LR = PC + 4;
|
||||||
|
// Would really like to continue the block here, but it ends. TODO.
|
||||||
|
SetJumpTarget(b);
|
||||||
WriteExitDestInEAX(0);
|
WriteExitDestInEAX(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user