[ARM] Fix and enable fastmem for 32bit stores.

This commit is contained in:
Ryan Houdek 2013-09-03 05:05:10 +00:00
parent c97229f612
commit d4d6eb562e
1 changed files with 17 additions and 15 deletions

View File

@ -33,13 +33,12 @@
void JitArm::UnsafeStoreFromReg(ARMReg dest, ARMReg value, int accessSize, s32 offset) void JitArm::UnsafeStoreFromReg(ARMReg dest, ARMReg value, int accessSize, s32 offset)
{ {
ARMReg rA = R11;
// All this gets replaced on backpatch // All this gets replaced on backpatch
MOVI2R(rA, Memory::MEMVIEW32_MASK, false); // 1-2 MOVI2R(R14, Memory::MEMVIEW32_MASK, false); // 1-2
AND(dest, dest, rA); // 3 AND(dest, dest, R14); // 3
MOVI2R(rA, (u32)Memory::base, false); // 4-5 MOVI2R(R14, (u32)Memory::base, false); // 4-5
ADD(dest, dest, rA); // 6 ADD(dest, dest, R14); // 6
switch (accessSize) switch (accessSize)
{ {
case 32: case 32:
@ -70,28 +69,29 @@ void JitArm::SafeStoreFromReg(bool fastmem, s32 dest, u32 value, s32 regOffset,
{ {
if (Core::g_CoreStartupParameter.bFastmem && fastmem) if (Core::g_CoreStartupParameter.bFastmem && fastmem)
{ {
ARMReg rA = R10;
ARMReg rB = R12;
ARMReg RA; ARMReg RA;
ARMReg RB; ARMReg RB;
ARMReg RS = gpr.R(value); ARMReg RS = gpr.R(value);
if (dest != -1)
RA = gpr.R(dest);
if (regOffset != -1) if (regOffset != -1)
{ {
RB = gpr.R(regOffset); RB = gpr.R(regOffset);
MOV(rA, RB); MOV(R10, RB);
NOP(1);
} }
else else
MOVI2R(rA, offset); MOVI2R(R10, (u32)offset, false);
if (dest != -1) if (dest != -1)
{ ADD(R10, R10, RA);
RA = gpr.R(dest); else
ADD(rA, rA, RA); NOP(1);
}
MOV(rB, RS); MOV(R12, RS);
UnsafeStoreFromReg(rA, rB, accessSize, 0); UnsafeStoreFromReg(R10, R12, accessSize, 0);
return; return;
} }
ARMReg rA = gpr.GetReg(); ARMReg rA = gpr.GetReg();
@ -155,6 +155,7 @@ void JitArm::stX(UGeckoInstruction inst)
zeroA = false; zeroA = false;
update = true; update = true;
case 151: // stwx case 151: // stwx
fastmem = true;
accessSize = 32; accessSize = 32;
regOffset = b; regOffset = b;
break; break;
@ -177,6 +178,7 @@ void JitArm::stX(UGeckoInstruction inst)
case 37: // stwu case 37: // stwu
update = true; update = true;
case 36: // stw case 36: // stw
fastmem = true;
accessSize = 32; accessSize = 32;
break; break;
case 39: // stbu case 39: // stbu