Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ARM] Fix lfs/lfd. We need to dump the fpr cache at times where VFP r…
…egisters may be affected. We shouldn't need to flush D8-D15 but it doesn't seem to work. So we have to flush all registers.
  • Loading branch information
Sonicadvance1 committed Aug 30, 2013
1 parent b5d5296 commit 10c18e7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Source/Core/Core/Src/PowerPC/JitArm32/JitArm_LoadStoreFloating.cpp
Expand Up @@ -37,7 +37,6 @@ void JitArm::lfs(UGeckoInstruction inst)
INSTRUCTION_START
JITDISABLE(LoadStoreFloating)

Default(inst); return;
ARMReg rA = gpr.GetReg();
ARMReg rB = gpr.GetReg();
LDR(rA, R9, PPCSTATE_OFF(Exceptions));
Expand All @@ -53,13 +52,16 @@ void JitArm::lfs(UGeckoInstruction inst)
else
MOVI2R(rB, (u32)inst.SIMM_16);

ARMReg v0 = fpr.R0(inst.FD);
ARMReg v1 = fpr.R1(inst.FD);

fpr.Flush();

MOVI2R(rA, (u32)&Memory::Read_F32);
PUSH(4, R0, R1, R2, R3);
MOV(R0, rB);
BL(rA);

ARMReg v0 = fpr.R0(inst.FD);
ARMReg v1 = fpr.R1(inst.FD);

VCVT(v0, S0, 0);
VCVT(v1, S0, 0);
POP(4, R0, R1, R2, R3);
Expand All @@ -72,7 +74,6 @@ void JitArm::lfd(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(LoadStoreFloating)
Default(inst); return;

ARMReg rA = gpr.GetReg();
ARMReg rB = gpr.GetReg();
Expand All @@ -89,12 +90,15 @@ void JitArm::lfd(UGeckoInstruction inst)
else
MOVI2R(rB, (u32)inst.SIMM_16);

ARMReg v0 = fpr.R0(inst.FD);
fpr.Flush();

MOVI2R(rA, (u32)&Memory::Read_F64);
PUSH(4, R0, R1, R2, R3);
MOV(R0, rB);
BL(rA);

ARMReg v0 = fpr.R0(inst.FD);

VMOV(v0, D0);
POP(4, R0, R1, R2, R3);

Expand Down

0 comments on commit 10c18e7

Please sign in to comment.