x86: correct access mode for cmp instruction (#1309)

cmp instruction does not modify its operands. Currently, cmp
variants that accept a memory operand have CS_AC_WRITE access mode
set. This commit removes CS_AC_WRITE mode from cmp variants that
have it.
This commit is contained in:
Ammar 2018-12-18 16:22:30 +01:00 committed by Nguyen Anh Quynh
parent 8d4ba8d335
commit 4e1b8c49f9
2 changed files with 21 additions and 21 deletions

View File

@ -1691,15 +1691,15 @@
},
{ /* X86_CMP16mi, X86_INS_CMP: cmp{w} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP16mi8, X86_INS_CMP: cmp{w} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP16mr, X86_INS_CMP: cmp{w} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP16ri, X86_INS_CMP: cmp{w} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
@ -1727,15 +1727,15 @@
},
{ /* X86_CMP32mi, X86_INS_CMP: cmp{l} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP32mi8, X86_INS_CMP: cmp{l} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP32mr, X86_INS_CMP: cmp{l} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP32ri, X86_INS_CMP: cmp{l} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
@ -1763,15 +1763,15 @@
},
{ /* X86_CMP64mi32, X86_INS_CMP: cmp{q} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP64mi8, X86_INS_CMP: cmp{q} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP64mr, X86_INS_CMP: cmp{q} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP64ri32, X86_INS_CMP: cmp{q} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,

View File

@ -1443,15 +1443,15 @@
},
{ /* X86_CMP16mi, X86_INS_CMP: cmp{w} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP16mi8, X86_INS_CMP: cmp{w} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP16mr, X86_INS_CMP: cmp{w} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP16ri, X86_INS_CMP: cmp{w} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
@ -1479,15 +1479,15 @@
},
{ /* X86_CMP32mi, X86_INS_CMP: cmp{l} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP32mi8, X86_INS_CMP: cmp{l} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP32mr, X86_INS_CMP: cmp{l} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP32ri, X86_INS_CMP: cmp{l} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
@ -1515,15 +1515,15 @@
},
{ /* X86_CMP64mi32, X86_INS_CMP: cmp{q} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP64mi8, X86_INS_CMP: cmp{q} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP64mr, X86_INS_CMP: cmp{q} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP64ri32, X86_INS_CMP: cmp{q} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
@ -1551,15 +1551,15 @@
},
{ /* X86_CMP8mi, X86_INS_CMP: cmp{b} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP8mi8, X86_INS_CMP: cmp{b} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_IGNORE, 0 }
{ CS_AC_READ, CS_AC_IGNORE, 0 }
},
{ /* X86_CMP8mr, X86_INS_CMP: cmp{b} $dst, $src */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,
{ CS_AC_READ | CS_AC_WRITE, CS_AC_READ, 0 }
{ CS_AC_READ, CS_AC_READ, 0 }
},
{ /* X86_CMP8ri, X86_INS_CMP: cmp{b} $src1, $src2 */
X86_EFLAGS_MODIFY_OF | X86_EFLAGS_MODIFY_SF | X86_EFLAGS_MODIFY_ZF | X86_EFLAGS_MODIFY_AF | X86_EFLAGS_MODIFY_PF | X86_EFLAGS_MODIFY_CF,