Skip to content

Commit 585943a

Browse files
committed
Fix incorrect lifting of x86 ANDN/PANDN/VPANDN (Fix #8198)
1 parent 1699a20 commit 585943a

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

arch/x86/il.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -955,34 +955,31 @@ bool GetLowLevelILForInstruction(Architecture* arch, const uint64_t addr, LowLev
955955
il.AddInstruction(
956956
WriteILOperand(il, xedd, addr, 0, 0,
957957
il.And(opOneLen,
958-
ReadILOperand(il, xedd, addr, 0, 0),
959958
il.Not(
960959
opTwoLen,
961960
ReadILOperand(il, xedd, addr, 1, 1)
962961
),
962+
ReadILOperand(il, xedd, addr, 2, 2),
963963
IL_FLAGWRITE_ALL)));
964964
break;
965965
case XED_ICLASS_PANDN:
966966
il.AddInstruction(
967967
WriteILOperand(il, xedd, addr, 0, 0,
968968
il.And(opOneLen,
969-
ReadILOperand(il, xedd, addr, 0, 0),
970-
il.Not(
971-
opTwoLen,
972-
ReadILOperand(il, xedd, addr, 1, 1)
973-
),
974-
0))); // Does not affect flags
969+
il.Not(opOneLen, ReadILOperand(il, xedd, addr, 0, 0)),
970+
ReadILOperand(il, xedd, addr, 1, 1),
971+
0))); // PANDN doesn't modify any flag.
975972
break;
976973
case XED_ICLASS_VPANDN:
977974
il.AddInstruction(
978975
WriteILOperand(il, xedd, addr, 0, 0,
979976
il.And(opOneLen,
980-
ReadILOperand(il, xedd, addr, 1, 1),
981977
il.Not(
982978
opTwoLen,
983-
ReadILOperand(il, xedd, addr, 2, 2)
979+
ReadILOperand(il, xedd, addr, 1, 1)
984980
),
985-
IL_FLAGWRITE_ALL)));
981+
ReadILOperand(il, xedd, addr, 2, 2),
982+
0)));
986983
break;
987984

988985
case XED_ICLASS_BT:

0 commit comments

Comments
 (0)