Skip to content

Commit a77ea94

Browse files
authored
[X86][MC] Update condition about ExplicitVEXPrefix (#73312)
After #72835, ExplicitVEXPrefix has changed and it is not a bit now, but in scope ExplicitOpPrefix, so the bitwise op of ExplicitVEXPrefix may need to update.
1 parent c419f3e commit a77ea94

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3973,7 +3973,8 @@ unsigned X86AsmParser::checkTargetMatchPredicate(MCInst &Inst) {
39733973
(MCID.TSFlags & X86II::EncodingMask) != X86II::VEX)
39743974
return Match_Unsupported;
39753975

3976-
if (MCID.TSFlags & X86II::ExplicitVEXPrefix &&
3976+
if ((MCID.TSFlags & X86II::ExplicitOpPrefixMask) ==
3977+
X86II::ExplicitVEXPrefix &&
39773978
(ForcedVEXEncoding != VEXEncoding_VEX &&
39783979
ForcedVEXEncoding != VEXEncoding_VEX2 &&
39793980
ForcedVEXEncoding != VEXEncoding_VEX3))

llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ void X86InstPrinterCommon::printInstFlags(const MCInst *MI, raw_ostream &O,
370370
O << "\trep\t";
371371

372372
// These all require a pseudo prefix
373-
if ((Flags & X86::IP_USE_VEX) || (TSFlags & X86II::ExplicitVEXPrefix))
373+
if ((Flags & X86::IP_USE_VEX) ||
374+
(TSFlags & X86II::ExplicitOpPrefixMask) == X86II::ExplicitVEXPrefix)
374375
O << "\t{vex}";
375376
else if (Flags & X86::IP_USE_VEX2)
376377
O << "\t{vex2}";

0 commit comments

Comments
 (0)