[ARM] lmw implementation.

This commit is contained in:
Ryan Houdek 2013-09-03 09:55:15 +00:00
parent 30cd436e86
commit 39ad48dfa5
3 changed files with 26 additions and 1 deletions

View File

@ -179,6 +179,7 @@ public:
// LoadStore // LoadStore
void stX(UGeckoInstruction _inst); void stX(UGeckoInstruction _inst);
void lXX(UGeckoInstruction _inst); void lXX(UGeckoInstruction _inst);
void lmw(UGeckoInstruction _inst);
void icbi(UGeckoInstruction _inst); void icbi(UGeckoInstruction _inst);
void dcbst(UGeckoInstruction _inst); void dcbst(UGeckoInstruction _inst);

View File

@ -436,6 +436,30 @@ void JitArm::LoadToReg(ARMReg dest, ARMReg addr, int accessSize, s32 offset)
gpr.Unlock(rA); gpr.Unlock(rA);
} }
// Some games use this heavily in video codecs
// We make the assumption that this pulls from main RAM at /all/ times
void JitArm::lmw(UGeckoInstruction inst)
{
u32 a = inst.RA;
ARMReg rA = gpr.GetReg();
ARMReg rB = gpr.GetReg();
MOVI2R(rA, inst.SIMM_16);
if (a)
ADD(rA, rA, gpr.R(a));
MOVI2R(rB, Memory::MEMVIEW32_MASK, false); // 1-2
AND(rA, rA, rB); // 3
MOVI2R(rB, (u32)Memory::base, false); // 4-5
ADD(rA, rA, rB); // 6
for (int i = inst.RD; i < 32; i++)
{
ARMReg RX = gpr.R(i);
LDR(RX, rA, (i - inst.RD) * 4);
REV(RX, RX);
}
gpr.Unlock(rA, rB);
}
void JitArm::dcbst(UGeckoInstruction inst) void JitArm::dcbst(UGeckoInstruction inst)
{ {
INSTRUCTION_START INSTRUCTION_START

View File

@ -94,7 +94,7 @@ static GekkoOPTemplate primarytable[] =
{38, &JitArm::stX}, //"stb", OPTYPE_STORE, FL_IN_A | FL_IN_S}}, {38, &JitArm::stX}, //"stb", OPTYPE_STORE, FL_IN_A | FL_IN_S}},
{39, &JitArm::stX}, //"stbu", OPTYPE_STORE, FL_OUT_A | FL_IN_A | FL_IN_S}}, {39, &JitArm::stX}, //"stbu", OPTYPE_STORE, FL_OUT_A | FL_IN_A | FL_IN_S}},
{46, &JitArm::Default}, //"lmw", OPTYPE_SYSTEM, FL_EVIL, 10}}, {46, &JitArm::lmw}, //"lmw", OPTYPE_SYSTEM, FL_EVIL, 10}},
{47, &JitArm::Default}, //"stmw", OPTYPE_SYSTEM, FL_EVIL, 10}}, {47, &JitArm::Default}, //"stmw", OPTYPE_SYSTEM, FL_EVIL, 10}},
{48, &JitArm::lfs}, //"lfs", OPTYPE_LOADFP, FL_IN_A}}, {48, &JitArm::lfs}, //"lfs", OPTYPE_LOADFP, FL_IN_A}},