JitArm64: Implement mcrfs
This commit is contained in:
parent
3e1a25ead0
commit
79a610b4b4
|
@ -118,6 +118,7 @@ public:
|
||||||
void crXXX(UGeckoInstruction inst);
|
void crXXX(UGeckoInstruction inst);
|
||||||
void mfcr(UGeckoInstruction inst);
|
void mfcr(UGeckoInstruction inst);
|
||||||
void mtcrf(UGeckoInstruction inst);
|
void mtcrf(UGeckoInstruction inst);
|
||||||
|
void mcrfs(UGeckoInstruction inst);
|
||||||
|
|
||||||
// LoadStore
|
// LoadStore
|
||||||
void lXX(UGeckoInstruction inst);
|
void lXX(UGeckoInstruction inst);
|
||||||
|
|
|
@ -687,3 +687,37 @@ void JitArm64::mtcrf(UGeckoInstruction inst)
|
||||||
gpr.Unlock(WB);
|
gpr.Unlock(WB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JitArm64::mcrfs(UGeckoInstruction inst)
|
||||||
|
{
|
||||||
|
INSTRUCTION_START
|
||||||
|
JITDISABLE(bJITSystemRegistersOff);
|
||||||
|
|
||||||
|
u8 shift = 4 * (7 - inst.CRFS);
|
||||||
|
u32 mask = 0xF << shift;
|
||||||
|
u32 field = inst.CRFD;
|
||||||
|
|
||||||
|
// Only clear exception bits (but not FEX/VX).
|
||||||
|
mask &= FPSCR_FX | FPSCR_ANY_X;
|
||||||
|
|
||||||
|
gpr.BindCRToRegister(field, false);
|
||||||
|
ARM64Reg CR = gpr.CR(field);
|
||||||
|
ARM64Reg WA = gpr.GetReg();
|
||||||
|
ARM64Reg WCR = EncodeRegTo32(CR);
|
||||||
|
ARM64Reg XA = EncodeRegTo64(WA);
|
||||||
|
|
||||||
|
LDR(IndexType::Unsigned, WA, PPC_REG, PPCSTATE_OFF(fpscr));
|
||||||
|
LSR(WCR, WA, shift);
|
||||||
|
ANDI2R(WCR, WCR, 0xF);
|
||||||
|
|
||||||
|
if (mask != 0)
|
||||||
|
{
|
||||||
|
ANDI2R(WA, WA, ~mask);
|
||||||
|
STR(IndexType::Unsigned, WA, PPC_REG, PPCSTATE_OFF(fpscr));
|
||||||
|
}
|
||||||
|
|
||||||
|
MOVP2R(XA, PowerPC::ConditionRegister::s_crTable.data());
|
||||||
|
LDR(CR, XA, ArithOption(CR, true));
|
||||||
|
|
||||||
|
gpr.Unlock(WA);
|
||||||
|
}
|
||||||
|
|
|
@ -315,7 +315,7 @@ constexpr std::array<GekkoOPTemplate, 15> table63{{
|
||||||
{40, &JitArm64::fp_logic}, // fnegx
|
{40, &JitArm64::fp_logic}, // fnegx
|
||||||
{12, &JitArm64::frspx}, // frspx
|
{12, &JitArm64::frspx}, // frspx
|
||||||
|
|
||||||
{64, &JitArm64::FallBackToInterpreter}, // mcrfs
|
{64, &JitArm64::mcrfs}, // mcrfs
|
||||||
{583, &JitArm64::FallBackToInterpreter}, // mffsx
|
{583, &JitArm64::FallBackToInterpreter}, // mffsx
|
||||||
{70, &JitArm64::FallBackToInterpreter}, // mtfsb0x
|
{70, &JitArm64::FallBackToInterpreter}, // mtfsb0x
|
||||||
{38, &JitArm64::FallBackToInterpreter}, // mtfsb1x
|
{38, &JitArm64::FallBackToInterpreter}, // mtfsb1x
|
||||||
|
|
Loading…
Reference in New Issue