From e653968fa9cb34ee29cee7abb82607fe28608daf Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Mon, 2 Mar 2009 23:24:16 +0000 Subject: Generalize BuildVectorSDNode::isConstantSplat to use APInts and handle arbitrary vector sizes. Add an optional MinSplatBits parameter to specify a minimum for the splat element size. Update the PPC target to use the revised interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65899 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAGNodes.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h') diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index b10c865f09..e945b983ef 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1933,13 +1933,18 @@ public: /// BUILD_VECTORs. class BuildVectorSDNode : public SDNode { public: - /// isConstantSplat - check if this is a constant splat, and if so, return - /// the splat element value in SplatBits. Any undefined bits in that value - /// are set to zero, and the corresponding bits in the SplatUndef mask are - /// set. The SplatSize value is set to the splat element size in bytes. - /// HasAnyUndefs is set to true if any bits in the vector are undefined. - bool isConstantSplat(unsigned &SplatBits, unsigned &SplatUndef, - unsigned &SplatSize, bool &HasAnyUndefs); + /// isConstantSplat - Check if this is a constant splat, and if so, find the + /// smallest element size that splats the vector. If MinSplatBits is + /// nonzero, the element size must be at least that large. Note that the + /// splat element may be the entire vector (i.e., a one element vector). + /// Returns the splat element value in SplatValue. Any undefined bits in + /// that value are zero, and the corresponding bits in the SplatUndef mask + /// are set. The SplatBitSize value is set to the splat element size in + /// bits. HasAnyUndefs is set to true if any bits in the vector are + /// undefined. + bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, + unsigned &SplatBitSize, bool &HasAnyUndefs, + unsigned MinSplatBits = 0); static inline bool classof(const BuildVectorSDNode *) { return true; } static inline bool classof(const SDNode *N) { -- cgit v1.2.3