Skip to content

Commit b3c16c0

Browse files
committed
resolve comments
1 parent 870a734 commit b3c16c0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,12 @@ static int getInstructionIDWithAttrMask(uint16_t *instructionID,
11341134
return 0;
11351135
}
11361136

1137-
static bool isNFnotMap4(InternalInstruction *insn) {
1138-
// Promoted BMI instrs below has nf version.
1137+
static bool isNF(InternalInstruction *insn) {
1138+
// NF bit is the MSB of aaa.
1139+
if (nfFromEVEX4of4(insn->vectorExtensionPrefix[3]) &&
1140+
insn->opcodeType == MAP4)
1141+
return true;
1142+
// Promoted BMI instrs below has nf version but not in map4.
11391143
if (insn->opcodeType == THREEBYTE_38 &&
11401144
ppFromEVEX3of4(insn->vectorExtensionPrefix[2]) == VEX_PREFIX_NONE) {
11411145
switch (insn->opcode) {
@@ -1184,9 +1188,7 @@ static int getInstructionID(struct InternalInstruction *insn,
11841188
attrMask |= ATTR_EVEXKZ;
11851189
if (bFromEVEX4of4(insn->vectorExtensionPrefix[3]))
11861190
attrMask |= ATTR_EVEXB;
1187-
// nf bit is the MSB of aaa
1188-
if (nfFromEVEX4of4(insn->vectorExtensionPrefix[3]) &&
1189-
(insn->opcodeType == MAP4 || isNFnotMap4(insn)))
1191+
if (isNF(insn))
11901192
attrMask |= ATTR_EVEXNF;
11911193
else if (aaaFromEVEX4of4(insn->vectorExtensionPrefix[3]))
11921194
attrMask |= ATTR_EVEXK;

llvm/lib/Target/X86/X86InstrArithmetic.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,8 +1055,8 @@ defm ANDN64 : AndN<Xi64, "">, VEX, REX_W, Requires<[HasBMI, NoEGPR]>;
10551055
defm ANDN32 : AndN<Xi32, "_EVEX">, EVEX, Requires<[HasBMI, HasEGPR, In64BitMode]>;
10561056
defm ANDN64 : AndN<Xi64, "_EVEX">, EVEX, REX_W, Requires<[HasBMI, HasEGPR, In64BitMode]>;
10571057
let Pattern = [(null_frag)] in {
1058-
defm ANDN32 : AndN<Xi32, "_NF">, EVEX, EVEX_NF, Requires<[In64BitMode]>;
1059-
defm ANDN64 : AndN<Xi64, "_NF">, EVEX, EVEX_NF, REX_W, Requires<[In64BitMode]>;
1058+
defm ANDN32 : AndN<Xi32, "_NF">, EVEX, EVEX_NF, Requires<[In64BitMode]>;
1059+
defm ANDN64 : AndN<Xi64, "_NF">, EVEX, EVEX_NF, REX_W, Requires<[In64BitMode]>;
10601060
}
10611061
}
10621062

0 commit comments

Comments
 (0)