Merge pull request #2867 from Tilka/mtspr_hid0
Jit64: implement HID0 case of mtspr
This commit is contained in:
commit
bb7f3d1822
|
@ -175,6 +175,11 @@ FixupBranch Jit64::JumpIfCRFieldBit(int field, int bit, bool jump_if_set)
|
||||||
return FixupBranch();
|
return FixupBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DoICacheReset()
|
||||||
|
{
|
||||||
|
PowerPC::ppcState.iCache.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
void Jit64::mtspr(UGeckoInstruction inst)
|
void Jit64::mtspr(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
|
@ -193,13 +198,9 @@ void Jit64::mtspr(UGeckoInstruction inst)
|
||||||
|
|
||||||
case SPR_SRR0:
|
case SPR_SRR0:
|
||||||
case SPR_SRR1:
|
case SPR_SRR1:
|
||||||
// These are safe to do the easy way, see the bottom of this function.
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SPR_LR:
|
case SPR_LR:
|
||||||
case SPR_CTR:
|
case SPR_CTR:
|
||||||
// These are safe to do the easy way, see the bottom of this function.
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SPR_GQR0:
|
case SPR_GQR0:
|
||||||
case SPR_GQR0 + 1:
|
case SPR_GQR0 + 1:
|
||||||
|
@ -230,6 +231,20 @@ void Jit64::mtspr(UGeckoInstruction inst)
|
||||||
gpr.UnlockAll();
|
gpr.UnlockAll();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case SPR_HID0:
|
||||||
|
{
|
||||||
|
gpr.BindToRegister(d, true, false);
|
||||||
|
BTR(32, gpr.R(d), Imm8(31 - 20)); // ICFI
|
||||||
|
MOV(32, PPCSTATE(spr[iIndex]), gpr.R(d));
|
||||||
|
FixupBranch dont_reset_icache = J_CC(CC_NC);
|
||||||
|
BitSet32 regs = CallerSavedRegistersInUse();
|
||||||
|
ABI_PushRegistersAndAdjustStack(regs, 0);
|
||||||
|
ABI_CallFunction((void*)DoICacheReset);
|
||||||
|
ABI_PopRegistersAndAdjustStack(regs, 0);
|
||||||
|
SetJumpTarget(dont_reset_icache);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FALLBACK_IF(true);
|
FALLBACK_IF(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue