mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
LLE JIT: Fixed the shift direction of the lsrnrx, asrnrx, lsrnr and asrnr instructions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6653 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ef96ab7d4f
commit
b9d4534a35
@ -132,8 +132,7 @@ void DSPEmitter::andf(const UDSPInstruction opc)
|
|||||||
// g_dsp.r[DSP_REG_SR] |= SR_LOGIC_ZERO;
|
// g_dsp.r[DSP_REG_SR] |= SR_LOGIC_ZERO;
|
||||||
// else
|
// else
|
||||||
// g_dsp.r[DSP_REG_SR] &= ~SR_LOGIC_ZERO;
|
// g_dsp.r[DSP_REG_SR] &= ~SR_LOGIC_ZERO;
|
||||||
AND(16, R(RAX), Imm16(imm));
|
TEST(16, R(RAX), Imm16(imm));
|
||||||
CMP(16, R(RAX), Imm16(0));
|
|
||||||
FixupBranch notLogicZero = J_CC(CC_NE);
|
FixupBranch notLogicZero = J_CC(CC_NE);
|
||||||
OR(16, MDisp(R11, DSP_REG_SR * 2), Imm16(SR_LOGIC_ZERO));
|
OR(16, MDisp(R11, DSP_REG_SR * 2), Imm16(SR_LOGIC_ZERO));
|
||||||
FixupBranch exit = J();
|
FixupBranch exit = J();
|
||||||
@ -1500,7 +1499,7 @@ void DSPEmitter::lsrn(const UDSPInstruction opc)
|
|||||||
get_long_acc(0, RDX);
|
get_long_acc(0, RDX);
|
||||||
// acc &= 0x000000FFFFFFFFFFULL;
|
// acc &= 0x000000FFFFFFFFFFULL;
|
||||||
SHL(64, R(RDX), Imm8(24));
|
SHL(64, R(RDX), Imm8(24));
|
||||||
SAR(64, R(RDX), Imm8(24));
|
SHR(64, R(RDX), Imm8(24));
|
||||||
|
|
||||||
// if ((accm & 0x3f) == 0)
|
// if ((accm & 0x3f) == 0)
|
||||||
// shift = 0;
|
// shift = 0;
|
||||||
@ -1647,10 +1646,10 @@ void DSPEmitter::lsrnrx(const UDSPInstruction opc)
|
|||||||
FixupBranch shiftLeft = J_CC(CC_Z);
|
FixupBranch shiftLeft = J_CC(CC_Z);
|
||||||
NEG(16, R(RCX));
|
NEG(16, R(RCX));
|
||||||
ADD(16, R(RCX), Imm16(0x40));
|
ADD(16, R(RCX), Imm16(0x40));
|
||||||
SHL(64, R(RDX), R(RCX));
|
SAR(64, R(RDX), R(RCX));
|
||||||
FixupBranch exit = J();
|
FixupBranch exit = J();
|
||||||
SetJumpTarget(shiftLeft);
|
SetJumpTarget(shiftLeft);
|
||||||
SAR(64, R(RDX), R(RCX));
|
SHL(64, R(RDX), R(RCX));
|
||||||
SetJumpTarget(noShift);
|
SetJumpTarget(noShift);
|
||||||
SetJumpTarget(exit);
|
SetJumpTarget(exit);
|
||||||
|
|
||||||
@ -1708,10 +1707,10 @@ void DSPEmitter::asrnrx(const UDSPInstruction opc)
|
|||||||
FixupBranch shiftLeft = J_CC(CC_Z);
|
FixupBranch shiftLeft = J_CC(CC_Z);
|
||||||
NEG(16, R(RCX));
|
NEG(16, R(RCX));
|
||||||
ADD(16, R(RCX), Imm16(0x40));
|
ADD(16, R(RCX), Imm16(0x40));
|
||||||
SHL(64, R(RDX), R(RCX));
|
SAR(64, R(RDX), R(RCX));
|
||||||
FixupBranch exit = J();
|
FixupBranch exit = J();
|
||||||
SetJumpTarget(shiftLeft);
|
SetJumpTarget(shiftLeft);
|
||||||
SAR(64, R(RDX), R(RCX));
|
SHL(64, R(RDX), R(RCX));
|
||||||
SetJumpTarget(noShift);
|
SetJumpTarget(noShift);
|
||||||
SetJumpTarget(exit);
|
SetJumpTarget(exit);
|
||||||
|
|
||||||
@ -1770,14 +1769,13 @@ void DSPEmitter::lsrnr(const UDSPInstruction opc)
|
|||||||
FixupBranch shiftLeft = J_CC(CC_Z);
|
FixupBranch shiftLeft = J_CC(CC_Z);
|
||||||
NEG(16, R(RCX));
|
NEG(16, R(RCX));
|
||||||
ADD(16, R(RCX), Imm16(0x40));
|
ADD(16, R(RCX), Imm16(0x40));
|
||||||
SHL(64, R(RDX), R(RCX));
|
SAR(64, R(RDX), R(RCX));
|
||||||
FixupBranch exit = J();
|
FixupBranch exit = J();
|
||||||
SetJumpTarget(shiftLeft);
|
SetJumpTarget(shiftLeft);
|
||||||
SAR(64, R(RDX), R(RCX));
|
SHL(64, R(RDX), R(RCX));
|
||||||
SetJumpTarget(noShift);
|
SetJumpTarget(noShift);
|
||||||
SetJumpTarget(exit);
|
SetJumpTarget(exit);
|
||||||
|
|
||||||
|
|
||||||
// dsp_set_long_acc(dreg, (s64)acc);
|
// dsp_set_long_acc(dreg, (s64)acc);
|
||||||
set_long_acc(dreg, RDX);
|
set_long_acc(dreg, RDX);
|
||||||
SetJumpTarget(zero);
|
SetJumpTarget(zero);
|
||||||
@ -1830,10 +1828,10 @@ void DSPEmitter::asrnr(const UDSPInstruction opc)
|
|||||||
FixupBranch shiftLeft = J_CC(CC_Z);
|
FixupBranch shiftLeft = J_CC(CC_Z);
|
||||||
NEG(16, R(RCX));
|
NEG(16, R(RCX));
|
||||||
ADD(16, R(RCX), Imm16(0x40));
|
ADD(16, R(RCX), Imm16(0x40));
|
||||||
SHL(64, R(RDX), R(RCX));
|
SAR(64, R(RDX), R(RCX));
|
||||||
FixupBranch exit = J();
|
FixupBranch exit = J();
|
||||||
SetJumpTarget(shiftLeft);
|
SetJumpTarget(shiftLeft);
|
||||||
SAR(64, R(RDX), R(RCX));
|
SHL(64, R(RDX), R(RCX));
|
||||||
SetJumpTarget(noShift);
|
SetJumpTarget(noShift);
|
||||||
SetJumpTarget(exit);
|
SetJumpTarget(exit);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user