From b848365f780f945149135b581a6c20a3d8cbecd6 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sat, 29 Nov 2014 06:51:35 +0000 Subject: [PATCH] [ARM32] Minor optimization in paired loadstores. When the offset can fit in the instruction encoding make sure to do so. --- .../JitArm32/JitArm_LoadStorePaired.cpp | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStorePaired.cpp b/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStorePaired.cpp index 6742e1ccc5..e0e485903a 100644 --- a/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStorePaired.cpp +++ b/Source/Core/Core/PowerPC/JitArm32/JitArm_LoadStorePaired.cpp @@ -35,9 +35,21 @@ void JitArm::psq_l(UGeckoInstruction inst) UBFX(R11, R11, 24, 6); // Scale LSL(R11, R11, 2); - MOVI2R(R10, (u32)offset); - if (inst.RA || update) // Always uses the register on update - ADD(R10, R10, gpr.R(inst.RA)); + Operand2 off; + if (TryMakeOperand2(offset, off)) + { + 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) MOV(gpr.R(inst.RA), R10); MOVI2R(R14, (u32)asm_routines.pairedLoadQuantized); @@ -126,14 +138,19 @@ void JitArm::psq_st(UGeckoInstruction inst) UBFX(R11, R11, 8, 6); // Scale LSL(R11, R11, 2); - if (inst.RA || update) // Always uses the register on update + Operand2 off; + if (TryMakeOperand2(offset, off)) { - MOVI2R(R14, offset); - ADD(R10, gpr.R(inst.RA), R14); + 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)