diff options
| author | Pengfei Wang <pengfei.wang@intel.com> | 2019-05-31 02:50:41 +0000 |
|---|---|---|
| committer | Pengfei Wang <pengfei.wang@intel.com> | 2019-05-31 02:50:41 +0000 |
| commit | 2e67d0c842c5c937f1f1053f211e1c5755f9edad (patch) | |
| tree | b2dd85109a2a312cb517fcab7a5de9cf955c4e16 /llvm/lib/Target/X86/MCTargetDesc | |
| parent | d2f53af605ab0f43beb73a62cee0b2e9fb24f11e (diff) | |
| download | bcm5719-llvm-2e67d0c842c5c937f1f1053f211e1c5755f9edad.tar.gz bcm5719-llvm-2e67d0c842c5c937f1f1053f211e1c5755f9edad.zip | |
[X86] Add VP2INTERSECT instructions
Support Intel AVX512 VP2INTERSECT instructions in llvm
Patch by Xiang Zhang (xiangzhangllvm)
Differential Revision: https://reviews.llvm.org/D62366
llvm-svn: 362188
Diffstat (limited to 'llvm/lib/Target/X86/MCTargetDesc')
| -rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp | 25 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp index 878ce590550..a2155507697 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp @@ -335,3 +335,28 @@ void X86InstPrinterCommon::printInstFlags(const MCInst *MI, raw_ostream &O) { else if (Flags & X86::IP_HAS_REPEAT) O << "\trep\t"; } + +void X86InstPrinterCommon::printVKPair(const MCInst *MI, unsigned OpNo, + raw_ostream &OS) { + // In assembly listings, a pair is represented by one of its members, any + // of the two. Here, we pick k0, k2, k4, k6, but we could as well + // print K2_K3 as "k3". It would probably make a lot more sense, if + // the assembly would look something like: + // "vp2intersect %zmm5, %zmm7, {%k2, %k3}" + // but this can work too. + switch (MI->getOperand(OpNo).getReg()) { + case X86::K0_K1: + printRegName(OS, X86::K0); + return; + case X86::K2_K3: + printRegName(OS, X86::K2); + return; + case X86::K4_K5: + printRegName(OS, X86::K4); + return; + case X86::K6_K7: + printRegName(OS, X86::K6); + return; + } + llvm_unreachable("Unknown mask pair register name"); +} diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h index 03c761dbcb7..8e28f24b619 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h +++ b/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h @@ -33,6 +33,7 @@ public: protected: void printInstFlags(const MCInst *MI, raw_ostream &O); void printOptionalSegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O); + void printVKPair(const MCInst *MI, unsigned OpNo, raw_ostream &OS); }; } // end namespace llvm |

