From 9b6f2859a44ddb65f8e3693d7fdb194c7aecabb0 Mon Sep 17 00:00:00 2001 From: Sintendo Date: Wed, 5 Jun 2019 23:23:22 +0200 Subject: [PATCH] DSPJitUtil: Micro-optimize increment_addr_reg 2 bytes shorter. Before: 0: 41 0f b7 c2 movzx eax,r10w 4: 41 89 c5 mov r13d,eax 7: 83 c0 01 add eax,0x1 After: 0: 45 0f b7 ea movzx r13d,r10w 4: 41 8d 45 01 lea eax,[r13+0x1] --- Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp index 630fc249d5..397d45b1b9 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp @@ -317,12 +317,11 @@ void DSPEmitter::increment_addr_reg(int reg) m_gpr.PutReg(DSP_REG_WR0 + reg, false); const OpArg ar_reg = m_gpr.GetReg(DSP_REG_AR0 + reg); - MOVZX(32, 16, EAX, ar_reg); - X64Reg tmp1 = m_gpr.GetFreeXReg(); + MOVZX(32, 16, tmp1, ar_reg); + // u32 nar = ar + 1; - MOV(32, R(tmp1), R(EAX)); - ADD(32, R(EAX), Imm8(1)); + LEA(32, EAX, MDisp(tmp1, 1)); // if ((nar ^ ar) > ((wr | 1) << 1)) // nar -= wr + 1;