This is an archive of the discontinued LLVM Phabricator instance.

[X86] Support avx512fp16 compare instructions in the IntelInstPrinter.
ClosedPublic

Authored by pengfei on Aug 15 2021, 12:51 PM.

Details

Summary

This enables printing of the mnemonics that contain the predicate
in the Intel printer. This requires accounting for the memory size
that is explicitly printed in Intel syntax. Those changes have been
synced to the ATT printer as well.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 15 2021, 12:51 PM
craig.topper requested review of this revision.Aug 15 2021, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2021, 12:51 PM
pengfei accepted this revision.Aug 15 2021, 6:10 PM

LGTM. Thanks Craig for fixing it.

llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

Why don't use assert like above?

This revision is now accepted and ready to land.Aug 15 2021, 6:10 PM
craig.topper added inline comments.Aug 15 2021, 6:14 PM
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

TA can also have PS and/or PD which need to got to EVEX_L2/VEX_L. So I didn't see a clean way to do it. Feel free to make a concrete suggestion.

pengfei added inline comments.Aug 15 2021, 6:31 PM
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

How about:

if ((Desc.TSFlags & X86II::OpPrefixMask) == X86II::XS) {
  if ((Desc.TSFlags & X86II::OpMapMask) == X86II::TA)
    printwordmem(MI, CurOp--, OS);
  else
    printdwordmem(MI, CurOp--, OS);
} else if ((Desc.TSFlags & X86II::OpPrefixMask) == X86II::XD) {
  assert((Desc.TSFlags & X86II::OpMapMask) != X86II::TA) &&
         "Unexpected op map!");
  printqwordmem(MI, CurOp--, OS);
} ...
pengfei added inline comments.Aug 15 2021, 6:35 PM
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

Sorry for the noise, I missed the EVEX_L2/VEX_L.

pengfei added inline comments.Aug 15 2021, 6:39 PM
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

Emm, seems correct :)

craig.topper added inline comments.Aug 15 2021, 6:44 PM
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

That should work. Do you mind taking over this patch?

pengfei added inline comments.Aug 15 2021, 6:45 PM
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp
203–207

Sure.

pengfei commandeered this revision.Aug 15 2021, 6:48 PM
pengfei edited reviewers, added: craig.topper; removed: pengfei.
This revision now requires review to proceed.Aug 15 2021, 6:48 PM
pengfei updated this revision to Diff 366543.Aug 15 2021, 8:20 PM

Refine the assertions and Intel syntax tests.

This revision is now accepted and ready to land.Aug 15 2021, 9:07 PM
This revision was landed with ongoing or failed builds.Aug 15 2021, 10:55 PM
This revision was automatically updated to reflect the committed changes.