DSP/Jit: Some small optimizations to lsrn emitter

This commit is contained in:
Pierre 2012-07-22 23:53:54 +02:00
parent 6873443a9a
commit 9c1d18a14c
1 changed files with 6 additions and 5 deletions

View File

@ -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);