diff options
author | Craig Topper <craig.topper@intel.com> | 2017-11-22 08:10:54 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-11-22 08:10:54 +0000 |
commit | ee74044f9301a6c658e1435b9cf5c05aa1284002 (patch) | |
tree | 2299f37207499c666c8e76f4eb26a9b67fdf483f /llvm/lib/Target/X86/X86ISelLowering.h | |
parent | 860a7b790154718fa509e81a70f10435719b8a5a (diff) | |
download | bcm5719-llvm-ee74044f9301a6c658e1435b9cf5c05aa1284002.tar.gz bcm5719-llvm-ee74044f9301a6c658e1435b9cf5c05aa1284002.zip |
[X86] Add an X86ISD::MSCATTER node for consistency with the X86ISD::MGATHER.
This makes the fact that X86 needs an explicit mask output not part of the type constraint for the ISD::MSCATTER.
This also gives the X86ISD::MGATHER/MSCATTER nodes a common base class simplifying the address selection code in X86ISelDAGToDAG.cpp
llvm-svn: 318823
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, |