From 8b578c7ba3e9cd1090ac14e4ef48ee2ee883d1dc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 27 Sep 2014 18:33:48 -0400 Subject: [PATCH] DSPJitRegCache: Merge two loops in popRegs. --- Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp index b071f9cad0..311c86f4f9 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp +++ b/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp @@ -505,26 +505,21 @@ void DSPJitRegCache::pushRegs() void DSPJitRegCache::popRegs() { emitter.MOV(64, M(&ebp_store), R(RBP)); - int push_count = 0; - for (X64CachedReg& xreg : xregs) - { - if (xreg.pushed) - { - push_count++; - } - } - for (int i = NUMXREGS-1; i >= 0; i--) + int push_count = 0; + for (int i = NUMXREGS - 1; i >= 0; i--) { if (xregs[i].pushed) { - emitter.POP((X64Reg)i); + push_count++; + + emitter.POP(static_cast(i)); xregs[i].pushed = false; xregs[i].guest_reg = DSP_REG_USED; } } - //hardcoding alignment to 16 bytes + // hardcoding alignment to 16 bytes if (push_count & 1) { emitter.ADD(64,R(RSP),Imm32(8));