Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Source/Core/Common/x64Emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,34 @@ void XEmitter::NOT(int bits, const OpArg& src)
WriteMulDivType(bits, src, 2);
}

void XEmitter::WriteIncDecType(int bits, OpArg src, int opReg)
{
ASSERT_MSG(DYNA_REC, !src.IsImm(), "WriteIncDecType - Imm argument");
CheckFlags();
if (bits == 16)
Write8(0x66);
src.WriteREX(this, bits, bits, 0);
if (bits == 8)
{
Write8(0xFE);
}
else
{
Write8(0xFF);
}
src.WriteRest(this, 0, (X64Reg)opReg);
}

void XEmitter::INC(int bits, const OpArg& src)
{
WriteIncDecType(bits, src, 0);
}

void XEmitter::DEC(int bits, const OpArg& src)
{
WriteIncDecType(bits, src, 1);
}

void XEmitter::WriteBitSearchType(int bits, X64Reg dest, OpArg src, u8 byte2, bool rep)
{
ASSERT_MSG(DYNA_REC, !src.IsImm(), "WriteBitSearchType - Imm argument");
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Common/x64Emitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ class XEmitter
void WriteSimple1Byte(int bits, u8 byte, X64Reg reg);
void WriteSimple2Byte(int bits, u8 byte1, u8 byte2, X64Reg reg);
void WriteMulDivType(int bits, OpArg src, int ext);
void WriteIncDecType(int bits, OpArg src, int opReg);
void WriteBitSearchType(int bits, X64Reg dest, OpArg src, u8 byte2, bool rep = false);
void WriteShift(int bits, OpArg dest, const OpArg& shift, int ext);
void WriteBitTest(int bits, const OpArg& dest, const OpArg& index, int ext);
Expand Down Expand Up @@ -501,6 +502,10 @@ class XEmitter
void DIV(int bits, const OpArg& src);
void IDIV(int bits, const OpArg& src);

// Inc / Dec
void INC(int bits, const OpArg& src);
void DEC(int bits, const OpArg& src);

// Shift
void ROL(int bits, const OpArg& dest, const OpArg& shift);
void ROR(int bits, const OpArg& dest, const OpArg& shift);
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void Jit64::bcx(UGeckoInstruction inst)
FixupBranch pCTRDontBranch;
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR
{
SUB(32, PPCSTATE_CTR, Imm8(1));
DEC(32, PPCSTATE_CTR);
if (inst.BO & BO_BRANCH_IF_CTR_0)
pCTRDontBranch = J_CC(CC_NZ, Jump::Near);
else
Expand Down Expand Up @@ -363,7 +363,7 @@ void Jit64::bclrx(UGeckoInstruction inst)
FixupBranch pCTRDontBranch;
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR
{
SUB(32, PPCSTATE_CTR, Imm8(1));
DEC(32, PPCSTATE_CTR);
if (inst.BO & BO_BRANCH_IF_CTR_0)
pCTRDontBranch = J_CC(CC_NZ, Jump::Near);
else
Expand Down