From 9c1d18a14cd010f251c5af4f81c73d630d24444d Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 22 Jul 2012 23:53:54 +0200 Subject: [PATCH] DSP/Jit: Some small optimizations to lsrn emitter --- Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp index 185ada8ba3..85511c1b9d 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp @@ -1570,16 +1570,17 @@ void DSPEmitter::lsrn(const UDSPInstruction opc) // acc <<= -shift; // } - CMP(64, R(RDX), Imm8(0)); + CMP(64, R(RDX), Imm8(0));//is this actually worth the branch cost? FixupBranch zero = J_CC(CC_E); - TEST(16, R(RAX), Imm16(0x3f)); + TEST(16, R(RAX), Imm16(0x3f));//is this actually worth the branch cost? FixupBranch noShift = J_CC(CC_Z); - MOVZX(64, 16, RCX, R(RAX)); - AND(16, R(RCX), Imm16(0x3f)); +//CL gets automatically masked with 0x3f on IA32/AMD64 + //MOVZX(64, 16, RCX, R(RAX)); + //AND(16, R(RCX), Imm16(0x3f)); TEST(16, R(RAX), Imm16(0x40)); FixupBranch shiftLeft = J_CC(CC_Z); NEG(16, R(RCX)); - ADD(16, R(RCX), Imm16(0x40)); + //ADD(16, R(RCX), Imm16(0x40)); SHL(64, R(RDX), R(RCX)); FixupBranch exit = J(); SetJumpTarget(shiftLeft);