drcbex64: special case for and (nw)

This commit is contained in:
Ville Linde 2016-05-16 19:52:58 +03:00
parent efcba70c3f
commit 0069d44ff7

View File

@ -5040,6 +5040,10 @@ void drcbe_x64::op_and(x86code *&dst, const instruction &inst)
if (dstp.is_memory() && dstp == src1p)
emit_and_m32_p32(dst, MABS(dstp.memory()), src2p, inst); // and [dstp],src2p
// dstp == src2p in memory
else if (dstp.is_memory() && dstp == src2p)
emit_and_m32_p32(dst, MABS(dstp.memory()), src1p, inst); // and [dstp],src1p
// AND with immediate 0xff
else if (src2p.is_immediate_value(0xff) && inst.flags() == 0)
{
@ -5076,6 +5080,10 @@ void drcbe_x64::op_and(x86code *&dst, const instruction &inst)
if (dstp.is_memory() && dstp == src1p)
emit_and_m64_p64(dst, MABS(dstp.memory()), src2p, inst); // and [dstp],src2p
// dstp == src2p in memory
else if (dstp.is_memory() && dstp == src2p)
emit_and_m64_p64(dst, MABS(dstp.memory()), src1p, inst); // and [dstp],src1p
// AND with immediate 0xff
else if (src2p.is_immediate_value(0xff) && inst.flags() == 0)
{