Allow runtime setting of fastmem in ARM and disable since it seems to be causing issues again. Cortex-A9 only?

This commit is contained in:
Ryan Houdek 2013-04-20 17:36:49 +00:00
parent 05eda7b0c1
commit 9720d6b418
1 changed files with 127 additions and 108 deletions

View File

@ -34,7 +34,7 @@
#ifdef ANDROID
#define FASTMEM 0
#else
#define FASTMEM 1
#define FASTMEM 0
#endif
void JitArm::stbu(UGeckoInstruction inst)
{
@ -156,6 +156,8 @@ void JitArm::stw(UGeckoInstruction inst)
ARMReg RS = gpr.R(inst.RS);
#if FASTMEM
// R10 contains the dest address
if (Core::g_CoreStartupParameter.bFastmem)
{
ARMReg Value = R11;
ARMReg RA;
if (inst.RA)
@ -172,7 +174,10 @@ void JitArm::stw(UGeckoInstruction inst)
NOP(1);
}
StoreFromReg(R10, Value, 32, 0);
#else
}
else
#endif
{
ARMReg ValueReg = gpr.GetReg();
ARMReg Addr = gpr.GetReg();
ARMReg Function = gpr.GetReg();
@ -194,7 +199,7 @@ void JitArm::stw(UGeckoInstruction inst)
BL(Function);
POP(4, R0, R1, R2, R3);
gpr.Unlock(ValueReg, Addr, Function);
#endif
}
}
void JitArm::stwu(UGeckoInstruction inst)
{
@ -316,6 +321,8 @@ void JitArm::lbz(UGeckoInstruction inst)
// Backpatch route
// Gets loaded in to RD
// Address is in R10
if (Core::g_CoreStartupParameter.bFastmem)
{
gpr.Unlock(rA, rB);
if (inst.RA)
{
@ -325,8 +332,10 @@ void JitArm::lbz(UGeckoInstruction inst)
else
MOV(R10, 0); // - 4
LoadToReg(RD, R10, 8, inst.SIMM_16);
#else
}
else
#endif
{
if (inst.RA)
{
MOVI2R(rB, inst.SIMM_16);
@ -344,7 +353,7 @@ void JitArm::lbz(UGeckoInstruction inst)
POP(4, R0, R1, R2, R3);
MOV(RD, rA);
gpr.Unlock(rA, rB);
#endif
}
SetJumpTarget(DoNotLoad);
}
@ -411,6 +420,8 @@ void JitArm::lwz(UGeckoInstruction inst)
// Backpatch route
// Gets loaded in to RD
// Address is in R10
if (Core::g_CoreStartupParameter.bFastmem)
{
gpr.Unlock(rA, rB);
if (inst.RA)
{
@ -420,7 +431,10 @@ void JitArm::lwz(UGeckoInstruction inst)
else
MOV(R10, 0); // - 4
LoadToReg(RD, R10, 32, (u32)inst.SIMM_16);
#else
}
else
#endif
{
if (inst.RA)
{
MOVI2R(rB, inst.SIMM_16);
@ -438,7 +452,7 @@ void JitArm::lwz(UGeckoInstruction inst)
POP(4, R0, R1, R2, R3);
MOV(RD, rA);
gpr.Unlock(rA, rB);
#endif
}
SetJumpTarget(DoNotLoad);
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle &&
(inst.hex & 0xFFFF0000) == 0x800D0000 &&
@ -484,6 +498,8 @@ void JitArm::lwzx(UGeckoInstruction inst)
// Backpatch route
// Gets loaded in to RD
// Address is in R10
if (Core::g_CoreStartupParameter.bFastmem)
{
gpr.Unlock(rA, rB);
if (inst.RA)
{
@ -493,7 +509,10 @@ void JitArm::lwzx(UGeckoInstruction inst)
else
MOV(R10, RB); // -4
LoadToReg(RD, R10, 32, 0);
#else
}
else
#endif
{
if (inst.RA)
{
ARMReg RA = gpr.R(inst.RA);
@ -510,7 +529,7 @@ void JitArm::lwzx(UGeckoInstruction inst)
POP(4, R0, R1, R2, R3);
MOV(RD, rA);
gpr.Unlock(rA, rB);
#endif
}
SetJumpTarget(DoNotLoad);
//// u32 temp = Memory::Read_U32(_inst.RA ? (m_GPR[_inst.RA] + m_GPR[_inst.RB]) : m_GPR[_inst.RB]);
}