[ARM32] Minor optimization in paired loadstores.

When the offset can fit in the instruction encoding make sure to do so.
This commit is contained in:
Ryan Houdek 2014-11-29 06:51:35 +00:00
parent 52c6fb180b
commit b848365f78
1 changed files with 23 additions and 6 deletions

View File

@ -35,9 +35,21 @@ void JitArm::psq_l(UGeckoInstruction inst)
UBFX(R11, R11, 24, 6); // Scale UBFX(R11, R11, 24, 6); // Scale
LSL(R11, R11, 2); LSL(R11, R11, 2);
MOVI2R(R10, (u32)offset); Operand2 off;
if (inst.RA || update) // Always uses the register on update if (TryMakeOperand2(offset, off))
ADD(R10, R10, gpr.R(inst.RA)); {
if (inst.RA || update)
ADD(R10, gpr.R(inst.RA), off);
else
MOV(R10, off);
}
else
{
MOVI2R(R10, (u32)offset);
if (inst.RA || update) // Always uses the register on update
ADD(R10, R10, gpr.R(inst.RA));
}
if (update) if (update)
MOV(gpr.R(inst.RA), R10); MOV(gpr.R(inst.RA), R10);
MOVI2R(R14, (u32)asm_routines.pairedLoadQuantized); MOVI2R(R14, (u32)asm_routines.pairedLoadQuantized);
@ -126,14 +138,19 @@ void JitArm::psq_st(UGeckoInstruction inst)
UBFX(R11, R11, 8, 6); // Scale UBFX(R11, R11, 8, 6); // Scale
LSL(R11, R11, 2); LSL(R11, R11, 2);
if (inst.RA || update) // Always uses the register on update Operand2 off;
if (TryMakeOperand2(offset, off))
{ {
MOVI2R(R14, offset); if (inst.RA || update)
ADD(R10, gpr.R(inst.RA), R14); ADD(R10, gpr.R(inst.RA), off);
else
MOV(R10, off);
} }
else else
{ {
MOVI2R(R10, (u32)offset); MOVI2R(R10, (u32)offset);
if (inst.RA || update) // Always uses the register on update
ADD(R10, R10, gpr.R(inst.RA));
} }
if (update) if (update)