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

View File

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