diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.h')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.h | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h index b79addfe198..fc8519bb973 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -637,8 +637,8 @@ namespace llvm { // Vector truncating masked store with unsigned/signed saturation VMTRUNCSTOREUS, VMTRUNCSTORES, - // X86 specific gather - MGATHER + // X86 specific gather and scatter + MGATHER, MSCATTER, // WARNING: Do not add anything in the end unless you want the node to // have memop! In fact, starting from FIRST_TARGET_MEMORY_OPCODE all @@ -1423,16 +1423,15 @@ namespace llvm { } }; - // X86 specific Gather node. - // The class has the same order of operands as MaskedGatherSDNode for + // X86 specific Gather/Scatter nodes. + // The class has the same order of operands as MaskedGatherScatterSDNode for // convenience. - class X86MaskedGatherSDNode : public MemSDNode { + class X86MaskedGatherScatterSDNode : public MemSDNode { public: - X86MaskedGatherSDNode(unsigned Order, - const DebugLoc &dl, SDVTList VTs, EVT MemVT, - MachineMemOperand *MMO) - : MemSDNode(X86ISD::MGATHER, Order, dl, VTs, MemVT, MMO) - {} + X86MaskedGatherScatterSDNode(unsigned Opc, unsigned Order, + const DebugLoc &dl, SDVTList VTs, EVT MemVT, + MachineMemOperand *MMO) + : MemSDNode(Opc, Order, dl, VTs, MemVT, MMO) {} const SDValue &getBasePtr() const { return getOperand(3); } const SDValue &getIndex() const { return getOperand(4); } @@ -1440,10 +1439,35 @@ namespace llvm { const SDValue &getValue() const { return getOperand(1); } static bool classof(const SDNode *N) { + return N->getOpcode() == X86ISD::MGATHER || + N->getOpcode() == X86ISD::MSCATTER; + } + }; + + class X86MaskedGatherSDNode : public X86MaskedGatherScatterSDNode { + public: + X86MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, + EVT MemVT, MachineMemOperand *MMO) + : X86MaskedGatherScatterSDNode(X86ISD::MGATHER, Order, dl, VTs, MemVT, + MMO) {} + + static bool classof(const SDNode *N) { return N->getOpcode() == X86ISD::MGATHER; } }; + class X86MaskedScatterSDNode : public X86MaskedGatherScatterSDNode { + public: + X86MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, + EVT MemVT, MachineMemOperand *MMO) + : X86MaskedGatherScatterSDNode(X86ISD::MSCATTER, Order, dl, VTs, MemVT, + MMO) {} + + static bool classof(const SDNode *N) { + return N->getOpcode() == X86ISD::MSCATTER; + } + }; + /// Generate unpacklo/unpackhi shuffle mask. template <typename T = int> void createUnpackShuffleMask(MVT VT, SmallVectorImpl<T> &Mask, bool Lo, |