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
This commit is contained in:
Bob Wilson
2009-03-02 23:24:16 +00:00
parent 52349a919b
commit 24e338e8a3
3 changed files with 69 additions and 90 deletions
+12 -7
View File
@@ -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) {