Merge pull request #9960 from JosJuice/jitarm64-mtfsb1x

JitArm64: Implement mtfsb1x
This commit is contained in:
Mai M 2021-07-28 20:46:09 -04:00 committed by GitHub
commit c86c02e46b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 1 deletions

View File

@ -120,6 +120,7 @@ public:
void mcrfs(UGeckoInstruction inst); void mcrfs(UGeckoInstruction inst);
void mffsx(UGeckoInstruction inst); void mffsx(UGeckoInstruction inst);
void mtfsb0x(UGeckoInstruction inst); void mtfsb0x(UGeckoInstruction inst);
void mtfsb1x(UGeckoInstruction inst);
// LoadStore // LoadStore
void lXX(UGeckoInstruction inst); void lXX(UGeckoInstruction inst);

View File

@ -788,3 +788,31 @@ void JitArm64::mtfsb0x(UGeckoInstruction inst)
if (inst.CRBD >= 29) if (inst.CRBD >= 29)
UpdateRoundingMode(); UpdateRoundingMode();
} }
void JitArm64::mtfsb1x(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITSystemRegistersOff);
FALLBACK_IF(inst.Rc);
u32 mask = 0x80000000 >> inst.CRBD;
ARM64Reg WA = gpr.GetReg();
LDR(IndexType::Unsigned, WA, PPC_REG, PPCSTATE_OFF(fpscr));
if (mask & FPSCR_ANY_X)
{
ARM64Reg WB = gpr.GetReg();
TST(WA, LogicalImm(mask, 32));
ORR(WB, WA, LogicalImm(1 << 31, 32));
CSEL(WA, WA, WB, CCFlags::CC_NEQ);
gpr.Unlock(WB);
}
ORR(WA, WA, LogicalImm(mask, 32));
STR(IndexType::Unsigned, WA, PPC_REG, PPCSTATE_OFF(fpscr));
gpr.Unlock(WA);
if (inst.CRBD >= 29)
UpdateRoundingMode();
}

View File

@ -317,7 +317,7 @@ constexpr std::array<GekkoOPTemplate, 15> table63{{
{64, &JitArm64::mcrfs}, // mcrfs {64, &JitArm64::mcrfs}, // mcrfs
{583, &JitArm64::mffsx}, // mffsx {583, &JitArm64::mffsx}, // mffsx
{70, &JitArm64::mtfsb0x}, // mtfsb0x {70, &JitArm64::mtfsb0x}, // mtfsb0x
{38, &JitArm64::FallBackToInterpreter}, // mtfsb1x {38, &JitArm64::mtfsb1x}, // mtfsb1x
{134, &JitArm64::FallBackToInterpreter}, // mtfsfix {134, &JitArm64::FallBackToInterpreter}, // mtfsfix
{711, &JitArm64::FallBackToInterpreter}, // mtfsfx {711, &JitArm64::FallBackToInterpreter}, // mtfsfx
}}; }};