Fixes ARMv7 FP loadstores using fastmem when not enabled.

This commit is contained in:
Ryan Houdek 2014-11-16 21:12:11 -06:00
parent aa2fc1f66b
commit f9208dcc13
1 changed files with 56 additions and 47 deletions

View File

@ -135,8 +135,10 @@ void JitArm::lfXX(UGeckoInstruction inst)
MOV(RA, rB); MOV(RA, rB);
// This branch gets changed to a NOP when the fastpath fails // This branch gets changed to a NOP when the fastpath fails
FixupBranch fast_path = B(); FixupBranch fast_path;
FixupBranch slow_out; if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem)
fast_path = B();
{ {
PUSH(4, R0, R1, R2, R3); PUSH(4, R0, R1, R2, R3);
MOV(R0, rB); MOV(R0, rB);
@ -160,34 +162,36 @@ void JitArm::lfXX(UGeckoInstruction inst)
#endif #endif
} }
POP(4, R0, R1, R2, R3); POP(4, R0, R1, R2, R3);
slow_out = B();
} }
SetJumpTarget(fast_path); if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem)
{ {
Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK) FixupBranch slow_out = B();
ARMReg rC = gpr.GetReg(); SetJumpTarget(fast_path);
BIC(rC, rB, mask); {
MOVI2R(rA, (u32)Memory::base); Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
ADD(rC, rC, rA); ARMReg rC = gpr.GetReg();
BIC(rC, rB, mask);
MOVI2R(rA, (u32)Memory::base);
ADD(rC, rC, rA);
NEONXEmitter nemit(this); NEONXEmitter nemit(this);
if (single) if (single)
{ {
nemit.VLD1(F_32, D0, rC); nemit.VLD1(F_32, D0, rC);
nemit.VREV32(I_8, D0, D0); // Byte swap to result nemit.VREV32(I_8, D0, D0); // Byte swap to result
VCVT(v0, S0, 0); VCVT(v0, S0, 0);
VCVT(v1, S0, 0); VCVT(v1, S0, 0);
}
else
{
nemit.VLD1(I_64, v0, rC);
nemit.VREV64(I_8, v0, v0); // Byte swap to result
}
gpr.Unlock(rC);
} }
else SetJumpTarget(slow_out);
{
nemit.VLD1(I_64, v0, rC);
nemit.VREV64(I_8, v0, v0); // Byte swap to result
}
gpr.Unlock(rC);
} }
SetJumpTarget(slow_out);
gpr.Unlock(rA, rB); gpr.Unlock(rA, rB);
SetJumpTarget(DoNotLoad); SetJumpTarget(DoNotLoad);
} }
@ -309,8 +313,10 @@ void JitArm::stfXX(UGeckoInstruction inst)
} }
// This branch gets changed to a NOP when the fastpath fails // This branch gets changed to a NOP when the fastpath fails
FixupBranch fast_path = B(); FixupBranch fast_path;
FixupBranch slow_out; if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem)
fast_path = B();
{ {
PUSH(4, R0, R1, R2, R3); PUSH(4, R0, R1, R2, R3);
if (single) if (single)
@ -334,33 +340,36 @@ void JitArm::stfXX(UGeckoInstruction inst)
BL(rA); BL(rA);
} }
POP(4, R0, R1, R2, R3); POP(4, R0, R1, R2, R3);
slow_out = B();
} }
SetJumpTarget(fast_path);
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem)
{ {
Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK) FixupBranch slow_out = B();
ARMReg rC = gpr.GetReg(); SetJumpTarget(fast_path);
BIC(rC, rB, mask); {
MOVI2R(rA, (u32)Memory::base); Operand2 mask(2, 1); // ~(Memory::MEMVIEW32_MASK)
ADD(rC, rC, rA); ARMReg rC = gpr.GetReg();
BIC(rC, rB, mask);
MOVI2R(rA, (u32)Memory::base);
ADD(rC, rC, rA);
NEONXEmitter nemit(this); NEONXEmitter nemit(this);
if (single) if (single)
{ {
VCVT(S0, v0, 0); VCVT(S0, v0, 0);
nemit.VREV32(I_8, D0, D0); nemit.VREV32(I_8, D0, D0);
VSTR(S0, rC, 0); VSTR(S0, rC, 0);
}
else
{
nemit.VREV64(I_8, D0, v0);
VSTR(D0, rC, 0);
}
gpr.Unlock(rC);
} }
else SetJumpTarget(slow_out);
{
nemit.VREV64(I_8, D0, v0);
VSTR(D0, rC, 0);
}
gpr.Unlock(rC);
} }
SetJumpTarget(slow_out);
gpr.Unlock(rA, rB); gpr.Unlock(rA, rB);
} }