mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-31 14:47:10 +00:00
Add function to emit CMP, or TEST when possible
Also, a spelling mistake.
This commit is contained in:
parent
b35c34186c
commit
c19482c9a3
4 changed files with 16 additions and 2 deletions
|
@ -1278,6 +1278,18 @@ void XEmitter::MOV (int bits, const OpArg &a1, const OpArg &a2)
|
|||
void XEmitter::TEST(int bits, const OpArg &a1, const OpArg &a2) {CheckFlags(); WriteNormalOp(bits, nrmTEST, a1, a2);}
|
||||
void XEmitter::CMP (int bits, const OpArg &a1, const OpArg &a2) {CheckFlags(); WriteNormalOp(bits, nrmCMP, a1, a2);}
|
||||
void XEmitter::XCHG(int bits, const OpArg &a1, const OpArg &a2) {WriteNormalOp(bits, nrmXCHG, a1, a2);}
|
||||
void XEmitter::CMP_or_TEST(int bits, const OpArg &a1, const OpArg &a2)
|
||||
{
|
||||
CheckFlags();
|
||||
if (a1.IsSimpleReg() && a2.IsImm() && a2.offset == 0) // turn 'CMP reg, 0' into shorter 'TEST reg, reg'
|
||||
{
|
||||
WriteNormalOp(bits, nrmTEST, a1, a1);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteNormalOp(bits, nrmCMP, a1, a2);
|
||||
}
|
||||
}
|
||||
|
||||
void XEmitter::IMUL(int bits, X64Reg regOp, OpArg a1, OpArg a2)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue