[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.38 - 1.39 --- Log message: Document the encoding of MVT::ValueType. --- Diffs of the changes: (+6 -0) ValueTypes.h |6 ++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.38 llvm/include/llvm/CodeGen/ValueTypes.h:1.39 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.38 Tue Jun 26 10:20:04 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Wed Jun 27 10:28:26 2007 @@ -82,6 +82,12 @@ /// Note that simple doesn't necessary mean legal for the target machine. /// All legal value types must be simple, but often there are some simple /// value types that are not legal. + /// + /// @internal + /// Currently extended types are always vector types. Extended types are + /// encoded by having the first SimpleTypeBits bits encode the vector + /// element type (which must be a scalar type) and the remaining upper + /// bits encode the vector length, offset by one. typedef uint32_t ValueType; static const int SimpleTypeBits = 8; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.39 - 1.40 --- Log message: Rename (shrinkify) MVT::isExtendedValueType to MVT::isExtendedVT. --- Diffs of the changes: (+6 -6) ValueTypes.h | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.39 llvm/include/llvm/CodeGen/ValueTypes.h:1.40 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.39 Wed Jun 27 10:28:26 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Wed Jun 27 11:08:04 2007 @@ -95,9 +95,9 @@ static const uint32_t SimpleTypeMask = (~uint32_t(0) (32 - SimpleTypeBits)) (32 - SimpleTypeBits); - /// MVT::isExtendedValueType - Test if the given ValueType is extended + /// MVT::isExtendedVT - Test if the given ValueType is extended /// (as opposed to being simple). - static inline bool isExtendedValueType(ValueType VT) { + static inline bool isExtendedVT(ValueType VT) { return VT SimpleTypeMask; } @@ -117,7 +117,7 @@ /// MVT::isVector - Return true if this is a vector value type. static inline bool isVector(ValueType VT) { return (VT = FIRST_VECTOR_VALUETYPE VT = LAST_VECTOR_VALUETYPE) || - isExtendedValueType(VT); + isExtendedVT(VT); } /// MVT::getVectorElementType - Given a vector type, return the type of @@ -125,7 +125,7 @@ static inline ValueType getVectorElementType(ValueType VT) { switch (VT) { default: - if (isExtendedValueType(VT)) + if (isExtendedVT(VT)) return VT SimpleTypeMask; assert(0 Invalid vector type!); case v8i8 : @@ -147,7 +147,7 @@ static inline unsigned getVectorNumElements(ValueType VT) { switch (VT) { default: - if (isExtendedValueType(VT)) + if (isExtendedVT(VT)) return ((VT ~SimpleTypeMask) SimpleTypeBits) - 1; assert(0 Invalid vector type!); case v16i8: return 16; @@ -170,7 +170,7 @@ static inline unsigned getSizeInBits(ValueType VT) { switch (VT) { default: - if (isExtendedValueType(VT)) + if (isExtendedVT(VT)) return getSizeInBits(getVectorElementType(VT)) * getVectorNumElements(VT); assert(0 ValueType has no known size!); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h ValueTypes.td
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.36 - 1.37 ValueTypes.td updated: 1.4 - 1.5 --- Log message: Renumber the SimpleValueType values to fill in the hole left by removing MVT::Vector. --- Diffs of the changes: (+24 -25) ValueTypes.h | 26 +- ValueTypes.td | 23 +++ 2 files changed, 24 insertions(+), 25 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.36 llvm/include/llvm/CodeGen/ValueTypes.h:1.37 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.36 Mon Jun 25 11:23:39 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Tue Jun 26 09:28:59 2007 @@ -46,22 +46,22 @@ isVoid = 12, // This has no value -v8i8 = 14, // 8 x i8 -v4i16 = 15, // 4 x i16 -v2i32 = 16, // 2 x i32 -v1i64 = 17, // 1 x i64 -v16i8 = 18, // 16 x i8 -v8i16 = 19, // 8 x i16 -v4i32 = 20, // 4 x i32 -v2i64 = 21, // 2 x i64 - -v2f32 = 22, // 2 x f32 -v4f32 = 23, // 4 x f32 -v2f64 = 24, // 2 x f64 +v8i8 = 13, // 8 x i8 +v4i16 = 14, // 4 x i16 +v2i32 = 15, // 2 x i32 +v1i64 = 16, // 1 x i64 +v16i8 = 17, // 16 x i8 +v8i16 = 18, // 8 x i16 +v4i32 = 19, // 4 x i32 +v2i64 = 20, // 2 x i64 + +v2f32 = 21, // 2 x f32 +v4f32 = 22, // 4 x f32 +v2f64 = 23, // 2 x f64 FIRST_VECTOR_VALUETYPE = v8i8, LAST_VECTOR_VALUETYPE = v2f64, -LAST_VALUETYPE = 25, // This always remains at the end of the list. +LAST_VALUETYPE = 24, // This always remains at the end of the list. // iAny - An integer value of any bit width. This is used for intrinsics // that have overloadings based on integer bit widths. This is only for Index: llvm/include/llvm/CodeGen/ValueTypes.td diff -u llvm/include/llvm/CodeGen/ValueTypes.td:1.4 llvm/include/llvm/CodeGen/ValueTypes.td:1.5 --- llvm/include/llvm/CodeGen/ValueTypes.td:1.4 Sun Apr 1 02:17:45 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.td Tue Jun 26 09:28:59 2007 @@ -32,19 +32,18 @@ def f128 : ValueType128, 10; // 128-bit floating point value def FlagVT : ValueType0 , 11; // Condition code or machine flag def isVoid : ValueType0 , 12; // Produces no value -def Vector : ValueType0 , 13; // Abstract vector value -def v8i8 : ValueType64 , 14; // 8 x i8 vector value -def v4i16 : ValueType64 , 15; // 4 x i16 vector value -def v2i32 : ValueType64 , 16; // 2 x i32 vector value -def v1i64 : ValueType64 , 17; // 1 x i64 vector value +def v8i8 : ValueType64 , 13; // 8 x i8 vector value +def v4i16 : ValueType64 , 14; // 4 x i16 vector value +def v2i32 : ValueType64 , 15; // 2 x i32 vector value +def v1i64 : ValueType64 , 16; // 1 x i64 vector value -def v16i8 : ValueType128, 18; // 16 x i8 vector value -def v8i16 : ValueType128, 19; // 8 x i16 vector value -def v4i32 : ValueType128, 20; // 4 x i32 vector value -def v2i64 : ValueType128, 21; // 2 x i64 vector value -def v2f32 : ValueType64, 22; // 2 x f32 vector value -def v4f32 : ValueType128, 23; // 4 x f32 vector value -def v2f64 : ValueType128, 24; // 2 x f64 vector value +def v16i8 : ValueType128, 17; // 16 x i8 vector value +def v8i16 : ValueType128, 18; // 8 x i16 vector value +def v4i32 : ValueType128, 19; // 4 x i32 vector value +def v2i64 : ValueType128, 20; // 2 x i64 vector value +def v2f32 : ValueType64, 21; // 2 x f32 vector value +def v4f32 : ValueType128, 22; // 4 x f32 vector value +def v2f64 : ValueType128, 23; // 2 x f64 vector value // Pseudo valuetype to represent integer of any bit width def iAny : ValueType0 , 254; // integer value of any bit width ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.37 - 1.38 --- Log message: Simplify the expression for MVT::isExtendedValueType. --- Diffs of the changes: (+1 -1) ValueTypes.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.37 llvm/include/llvm/CodeGen/ValueTypes.h:1.38 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.37 Tue Jun 26 09:28:59 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Tue Jun 26 10:20:04 2007 @@ -92,7 +92,7 @@ /// MVT::isExtendedValueType - Test if the given ValueType is extended /// (as opposed to being simple). static inline bool isExtendedValueType(ValueType VT) { -return VT ~SimpleTypeMask; +return VT SimpleTypeMask; } /// MVT::isInteger - Return true if this is an integer, or a vector integer ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.34 - 1.35 --- Log message: Rename MVT::getVectorBaseType to MVT::getVectorElementType. --- Diffs of the changes: (+2 -2) ValueTypes.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.34 llvm/include/llvm/CodeGen/ValueTypes.h:1.35 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.34 Sat Apr 28 00:38:52 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Thu Jun 14 17:58:02 2007 @@ -129,9 +129,9 @@ /// ValueType getVectorType(ValueType VT, unsigned NumElements); - /// MVT::getVectorBaseType - Given a packed vector type, return the type of + /// MVT::getVectorElementType - Given a packed vector type, return the type of /// each element. - static inline ValueType getVectorBaseType(ValueType VT) { + static inline ValueType getVectorElementType(ValueType VT) { switch (VT) { default: assert(0 Invalid vector type!); case v8i8 : ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.33 - 1.34 --- Log message: add a way to make this less brittle --- Diffs of the changes: (+3 -2) ValueTypes.h |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.33 llvm/include/llvm/CodeGen/ValueTypes.h:1.34 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.33 Mon Apr 23 17:50:40 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sat Apr 28 00:38:52 2007 @@ -205,8 +205,9 @@ /// MVT::getValueType - Return the value type corresponding to the specified /// type. This returns all vectors as MVT::Vector and all pointers as - /// MVT::iPTR. - ValueType getValueType(const Type *Ty); + /// MVT::iPTR. If HandleUnknown is true, unknown types are returned as Other, + /// otherwise they are invalid. + ValueType getValueType(const Type *Ty, bool HandleUnknown = false); } } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.32 - 1.33 --- Log message: Fix bug in isFloatingPoint() --- Diffs of the changes: (+1 -1) ValueTypes.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.32 llvm/include/llvm/CodeGen/ValueTypes.h:1.33 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.32 Sun Apr 1 02:17:45 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Apr 23 17:50:40 2007 @@ -85,7 +85,7 @@ /// MVT::isFloatingPoint - Return true if this is a simple FP, or a packed /// vector FP type. static inline bool isFloatingPoint(ValueType VT) { -return (VT = f32 VT = f128) || (VT = v4f32 VT = v2f64); +return (VT = f32 VT = f128) || (VT = v2f32 VT = v2f64); } /// MVT::isVector - Return true if this is a packed vector type (i.e. not ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h ValueTypes.td
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.31 - 1.32 ValueTypes.td updated: 1.3 - 1.4 --- Log message: For PR1297: http://llvm.org/PR1297 : Add an iAny ValueType as a place holder for an integer type of any bit width. This is used for intrinsics overloading on integer type. --- Diffs of the changes: (+7 -0) ValueTypes.h |5 + ValueTypes.td |2 ++ 2 files changed, 7 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.31 llvm/include/llvm/CodeGen/ValueTypes.h:1.32 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.31 Fri Mar 30 23:03:02 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sun Apr 1 02:17:45 2007 @@ -66,6 +66,11 @@ LAST_VALUETYPE = 25, // This always remains at the end of the list. +// iAny - An integer value of any bit width. This is used for intrinsics +// that have overloadings based on integer bit widths. This is only for +// tblgen's consumption! +iAny = 254, + // iPTR - An int value the size of the pointer of the current // target. This should only be used internal to tblgen! iPTR = 255 Index: llvm/include/llvm/CodeGen/ValueTypes.td diff -u llvm/include/llvm/CodeGen/ValueTypes.td:1.3 llvm/include/llvm/CodeGen/ValueTypes.td:1.4 --- llvm/include/llvm/CodeGen/ValueTypes.td:1.3 Sat Mar 24 12:36:26 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.td Sun Apr 1 02:17:45 2007 @@ -46,6 +46,8 @@ def v4f32 : ValueType128, 23; // 4 x f32 vector value def v2f64 : ValueType128, 24; // 2 x f64 vector value +// Pseudo valuetype to represent integer of any bit width +def iAny : ValueType0 , 254; // integer value of any bit width // Pseudo valuetype mapped to the current pointer size. def iPTR : ValueType0 , 255; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.30 - 1.31 --- Log message: add a method to turn a type into a VT. --- Diffs of the changes: (+5 -0) ValueTypes.h |5 + 1 files changed, 5 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.30 llvm/include/llvm/CodeGen/ValueTypes.h:1.31 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.30 Sat Mar 24 12:36:26 2007 +++ llvm/include/llvm/CodeGen/ValueTypes.h Fri Mar 30 23:03:02 2007 @@ -197,6 +197,11 @@ /// to the specified ValueType. For integer types, this returns an unsigned /// type. Note that this will abort for types that cannot be represented. const Type *getTypeForValueType(ValueType VT); + + /// MVT::getValueType - Return the value type corresponding to the specified + /// type. This returns all vectors as MVT::Vector and all pointers as + /// MVT::iPTR. + ValueType getValueType(const Type *Ty); } } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h ValueTypes.td
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.29 - 1.30 ValueTypes.td updated: 1.2 - 1.3 --- Log message: add a valuetype for v1i64, which is needed by mmx. --- Diffs of the changes: (+34 -27) ValueTypes.h | 45 + ValueTypes.td | 16 +--- 2 files changed, 34 insertions(+), 27 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.29 llvm/include/llvm/CodeGen/ValueTypes.h:1.30 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.29 Tue Jul 18 19:40:45 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sat Mar 24 12:36:26 2007 @@ -52,18 +52,19 @@ v8i8 = 14, // 8 x i8 v4i16 = 15, // 4 x i16 v2i32 = 16, // 2 x i32 -v16i8 = 17, // 16 x i8 -v8i16 = 18, // 8 x i16 -v4i32 = 19, // 4 x i32 -v2i64 = 20, // 2 x i64 - -v2f32 = 21, // 2 x f32 -v4f32 = 22, // 4 x f32 -v2f64 = 23, // 2 x f64 +v1i64 = 17, // 1 x i64 +v16i8 = 18, // 16 x i8 +v8i16 = 19, // 8 x i16 +v4i32 = 20, // 4 x i32 +v2i64 = 21, // 2 x i64 + +v2f32 = 22, // 2 x f32 +v4f32 = 23, // 4 x f32 +v2f64 = 24, // 2 x f64 FIRST_VECTOR_VALUETYPE = v8i8, LAST_VECTOR_VALUETYPE = v2f64, -LAST_VALUETYPE = 24, // This always remains at the end of the list. +LAST_VALUETYPE = 25, // This always remains at the end of the list. // iPTR - An int value the size of the pointer of the current // target. This should only be used internal to tblgen! @@ -103,6 +104,7 @@ case MVT::v8i8: case MVT::v4i16: case MVT::v2i32: +case MVT::v1i64: case MVT::v2f32: return 64; case MVT::f80 : return 80; case MVT::f128: @@ -133,6 +135,7 @@ case v8i16: return i16; case v2i32: case v4i32: return i32; +case v1i64: case v2i64: return i64; case v2f32: case v4f32: return f32; @@ -144,17 +147,18 @@ /// of elements it contains. static inline unsigned getVectorNumElements(ValueType VT) { switch (VT) { - default: assert(0 Invalid vector type!); - case v16i8: return 16; - case v8i8 : - case v8i16: return 8; - case v4i16: - case v4i32: - case v4f32: return 4; - case v2i32: - case v2i64: - case v2f32: - case v2f64: return 2; +default: assert(0 Invalid vector type!); +case v16i8: return 16; +case v8i8 : +case v8i16: return 8; +case v4i16: +case v4i32: +case v4f32: return 4; +case v2i32: +case v2i64: +case v2f32: +case v2f64: return 2; +case v1i64: return 1; } } @@ -163,6 +167,7 @@ static inline ValueType getIntVectorWithNumElements(unsigned NumElts) { switch (NumElts) { default: assert(0 Invalid vector type!); +case 1: return v1i64; case 2: return v2i32; case 4: return v4i16; case 8: return v8i8; Index: llvm/include/llvm/CodeGen/ValueTypes.td diff -u llvm/include/llvm/CodeGen/ValueTypes.td:1.2 llvm/include/llvm/CodeGen/ValueTypes.td:1.3 --- llvm/include/llvm/CodeGen/ValueTypes.td:1.2 Mon Mar 27 16:48:00 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.td Sat Mar 24 12:36:26 2007 @@ -36,13 +36,15 @@ def v8i8 : ValueType64 , 14; // 8 x i8 vector value def v4i16 : ValueType64 , 15; // 4 x i16 vector value def v2i32 : ValueType64 , 16; // 2 x i32 vector value -def v16i8 : ValueType128, 17; // 16 x i8 vector value -def v8i16 : ValueType128, 18; // 8 x i16 vector value -def v4i32 : ValueType128, 19; // 4 x i32 vector value -def v2i64 : ValueType128, 20; // 2 x i64 vector value -def v2f32 : ValueType64, 21; // 2 x f32 vector value -def v4f32 : ValueType128, 22; // 4 x f32 vector value -def v2f64 : ValueType128, 23; // 2 x f64 vector value +def v1i64 : ValueType64 , 17; // 1 x i64 vector value + +def v16i8 : ValueType128, 18; // 16 x i8 vector value +def v8i16 : ValueType128, 19; // 8 x i16 vector value +def v4i32 : ValueType128, 20; // 4 x i32 vector value +def v2i64 : ValueType128, 21; // 2 x i64 vector value +def v2f32 : ValueType64, 22; // 2 x f32 vector value +def v4f32 : ValueType128, 23; // 4 x f32 vector value +def v2f64 : ValueType128, 24; // 2 x f64 vector value // Pseudo valuetype mapped to the current pointer size. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.28 - 1.29 --- Log message: Move MVT::getVectorType out of line, it is large and shouldn't be inlined. --- Diffs of the changes: (+2 -30) ValueTypes.h | 32 ++-- 1 files changed, 2 insertions(+), 30 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.28 llvm/include/llvm/CodeGen/ValueTypes.h:1.29 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.28 Wed May 24 14:21:13 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Tue Jul 18 19:40:45 2006 @@ -120,36 +120,8 @@ /// NumElements in length, where each element is of type VT. If there is no /// ValueType that represents this vector, a ValueType of Other is returned. /// - static inline ValueType getVectorType(ValueType VT, unsigned NumElements) { -switch (VT) { -default: - break; -case MVT::i8: - if (NumElements == 8) return MVT::v8i8; - if (NumElements == 16) return MVT::v16i8; -break; -case MVT::i16: - if (NumElements == 4) return MVT::v4i16; - if (NumElements == 8) return MVT::v8i16; -break; -case MVT::i32: - if (NumElements == 2) return MVT::v2i32; - if (NumElements == 4) return MVT::v4i32; -break; -case MVT::i64: - if (NumElements == 2) return MVT::v2i64; - break; -case MVT::f32: - if (NumElements == 2) return MVT::v2f32; - if (NumElements == 4) return MVT::v4f32; -break; -case MVT::f64: - if (NumElements == 2) return MVT::v2f64; - break; -} -return MVT::Other; - } - + ValueType getVectorType(ValueType VT, unsigned NumElements); + /// MVT::getVectorBaseType - Given a packed vector type, return the type of /// each element. static inline ValueType getVectorBaseType(ValueType VT) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.27 - 1.28 --- Log message: For PR786: http://llvm.cs.uiuc.edu/PR786 : Minor tweaks in public headers and a few .cpp files so that LLVM can build successfully with -pedantic and projects using LLVM with -pedantic don't get warnings from LLVM. There's still more -pedantic warnings to fix. --- Diffs of the changes: (+2 -2) ValueTypes.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.27 llvm/include/llvm/CodeGen/ValueTypes.h:1.28 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.27 Mon Mar 27 19:59:17 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Wed May 24 14:21:13 2006 @@ -203,13 +203,13 @@ /// bits in the specified integer value type. static inline uint64_t getIntVTBitMask(ValueType VT) { assert(isInteger(VT) !isVector(VT) Only applies to int scalars!); -return ~0ULL (64-getSizeInBits(VT)); +return ~uint64_t(0UL) (64-getSizeInBits(VT)); } /// MVT::getIntVTSignBit - Return an integer with a 1 in the position of the /// sign bit for the specified integer value type. static inline uint64_t getIntVTSignBit(ValueType VT) { assert(isInteger(VT) !isVector(VT) Only applies to int scalars!); -return 1ULL (getSizeInBits(VT)-1); +return uint64_t(1UL) (getSizeInBits(VT)-1); } /// MVT::getValueTypeString - This function returns value type as a string, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h ValueTypes.td
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.25 - 1.26 ValueTypes.td updated: 1.1 - 1.2 --- Log message: add a new iPTR ValueType for tblgen use --- Diffs of the changes: (+9 -1) ValueTypes.h |6 +- ValueTypes.td |4 2 files changed, 9 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.25 llvm/include/llvm/CodeGen/ValueTypes.h:1.26 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.25 Sun Mar 19 18:20:30 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Mar 27 16:48:00 2006 @@ -63,7 +63,11 @@ FIRST_VECTOR_VALUETYPE = v8i8, LAST_VECTOR_VALUETYPE = v2f64, -LAST_VALUETYPE = 24// This always remains at the end of the list. +LAST_VALUETYPE = 24, // This always remains at the end of the list. + +// iPTR - An int value the size of the pointer of the current +// target. This should only be used internal to tblgen! +iPTR = 255 }; /// MVT::isInteger - Return true if this is a simple integer, or a packed Index: llvm/include/llvm/CodeGen/ValueTypes.td diff -u llvm/include/llvm/CodeGen/ValueTypes.td:1.1 llvm/include/llvm/CodeGen/ValueTypes.td:1.2 --- llvm/include/llvm/CodeGen/ValueTypes.td:1.1 Thu Mar 2 19:54:11 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.td Mon Mar 27 16:48:00 2006 @@ -43,3 +43,7 @@ def v2f32 : ValueType64, 21; // 2 x f32 vector value def v4f32 : ValueType128, 22; // 4 x f32 vector value def v2f64 : ValueType128, 23; // 2 x f64 vector value + + +// Pseudo valuetype mapped to the current pointer size. +def iPTR : ValueType0 , 255; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.26 - 1.27 --- Log message: getVectorTyppe(MVT::i64, 2) == MVT::v2i64. --- Diffs of the changes: (+3 -0) ValueTypes.h |3 +++ 1 files changed, 3 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.26 llvm/include/llvm/CodeGen/ValueTypes.h:1.27 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.26 Mon Mar 27 16:48:00 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Mar 27 19:59:17 2006 @@ -136,6 +136,9 @@ if (NumElements == 2) return MVT::v2i32; if (NumElements == 4) return MVT::v4i32; break; +case MVT::i64: + if (NumElements == 2) return MVT::v2i64; + break; case MVT::f32: if (NumElements == 2) return MVT::v2f32; if (NumElements == 4) return MVT::v4f32; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.23 - 1.24 --- Log message: Add a helper method --- Diffs of the changes: (+18 -0) ValueTypes.h | 18 ++ 1 files changed, 18 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.23 llvm/include/llvm/CodeGen/ValueTypes.h:1.24 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.23 Sat Mar 18 23:26:45 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sun Mar 19 17:41:32 2006 @@ -161,6 +161,24 @@ } } + /// MVT::getVectorNumElements - Given a packed vector type, return the number + /// of elements it contains. + static inline unsigned getVectorNumElements(ValueType VT) { +switch (VT) { + default: assert(0 Invalid vector type!); + case v16i8: return 16; + case v8i8 : + case v8i16: return 8; + case v4i16: + case v4i32: + case v4f32: return 4; + case v2i32: + case v2i64: + case v2f32: + case v2f64: return 2; +} + } + /// MVT::getIntVTBitMask - Return an integer with 1's every place there are /// bits in the specified integer value type. static inline uint64_t getIntVTBitMask(ValueType VT) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.24 - 1.25 --- Log message: Add another helper --- Diffs of the changes: (+13 -0) ValueTypes.h | 13 + 1 files changed, 13 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.24 llvm/include/llvm/CodeGen/ValueTypes.h:1.25 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.24 Sun Mar 19 17:41:32 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sun Mar 19 18:20:30 2006 @@ -179,6 +179,19 @@ } } + /// MVT::getIntVectorWithNumElements - Return any integer vector type that has + /// the specified number of elements. + static inline ValueType getIntVectorWithNumElements(unsigned NumElts) { +switch (NumElts) { +default: assert(0 Invalid vector type!); +case 2: return v2i32; +case 4: return v4i16; +case 8: return v8i8; +case 16: return v16i8; +} + } + + /// MVT::getIntVTBitMask - Return an integer with 1's every place there are /// bits in the specified integer value type. static inline uint64_t getIntVTBitMask(ValueType VT) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.19 - 1.20 --- Log message: - Added v2f32, not used by any target currently. Only for testing purpose. - Minor bug fix. --- Diffs of the changes: (+27 -12) ValueTypes.h | 39 +++ 1 files changed, 27 insertions(+), 12 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.19 llvm/include/llvm/CodeGen/ValueTypes.h:1.20 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.19 Wed Feb 22 10:23:43 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Tue Feb 28 18:55:26 2006 @@ -56,20 +56,21 @@ v4i32 = 19, // 4 x i32 v2i64 = 20, // 2 x i64 -v4f32 = 21, // 4 x f32 -v2f64 = 22, // 2 x f64 +v2f32 = 21, // 2 x f32 +v4f32 = 22, // 4 x f32 +v2f64 = 23, // 2 x f64 LAST_VALUETYPE // This always remains at the end of the list. }; static inline bool isInteger(ValueType VT) { -return (VT = i1 VT = i128) || (VT = v16i8 VT = v2i64); +return (VT = i1 VT = i128) || (VT = v8i8 VT = v2i64); } static inline bool isFloatingPoint(ValueType VT) { return (VT = f32 VT = f128) || (VT = v4f32 VT = v2f64); } static inline bool isVector(ValueType VT) { -return (VT = v16i8 VT = v2f64); +return (VT = v8i8 VT = v2f64); } /// getVectorType - Returns the ValueType that represents a vector NumElements @@ -80,11 +81,24 @@ switch (VT) { default: break; +case MVT::i8: + if (NumElements == 8) return MVT::v8i8; + if (NumElements == 16) return MVT::v16i8; + break; +case MVT::i16: + if (NumElements == 4) return MVT::v4i16; + if (NumElements == 8) return MVT::v8i16; + break; case MVT::i32: - if (NumElements == 4) return MVT::v4i32; + if (NumElements == 2) return MVT::v2i32; + if (NumElements == 4) return MVT::v4i32; break; case MVT::f32: - if (NumElements == 4) return MVT::v4f32; + if (NumElements == 2) return MVT::v2f32; + if (NumElements == 4) return MVT::v4f32; + break; +case MVT::f64: + if (NumElements == 2) return MVT::v2f64; break; } return MVT::Other; @@ -93,17 +107,18 @@ static inline unsigned getSizeInBits(ValueType VT) { switch (VT) { default: assert(0 ValueType has no known size!); -case MVT::i1 : return 1; -case MVT::i8 : return 8; -case MVT::i16 : return 16; +case MVT::i1 : return 1; +case MVT::i8 : return 8; +case MVT::i16 : return 16; case MVT::f32 : -case MVT::i32 : return 32; +case MVT::i32 : return 32; case MVT::f64 : case MVT::i64 : case MVT::v8i8: case MVT::v4i16: -case MVT::v2i32:return 64; -case MVT::f80 : return 80; +case MVT::v2i32: +case MVT::v2f32: return 64; +case MVT::f80 : return 80; case MVT::f128: case MVT::i128: case MVT::v16i8: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.17 - 1.18 --- Log message: Added x86 integer vector types: 64-bit packed byte integer (v16i8), 64-bit packed word integer (v8i16), and 64-bit packed doubleword integer (v2i32). --- Diffs of the changes: (+13 -7) ValueTypes.h | 20 +--- 1 files changed, 13 insertions(+), 7 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.17 llvm/include/llvm/CodeGen/ValueTypes.h:1.18 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.17 Tue Feb 7 20:05:45 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Feb 20 16:34:53 2006 @@ -48,13 +48,16 @@ Vector = 13, // This is an abstract vector type, which will // be expanded into a target vector type, or scalars // if no matching vector type is available. -v16i8 = 14, // 16 x i8 -v8i16 = 15, // 8 x i16 -v4i32 = 16, // 4 x i32 -v2i64 = 17, // 2 x i64 +v8i8 = 14, // 8 x i8 +v4i16 = 15, // 4 x i16 +v2i32 = 16, // 2 x i32 +v16i8 = 17, // 16 x i8 +v8i16 = 18, // 8 x i16 +v4i32 = 19, // 4 x i32 +v2i64 = 20, // 2 x i64 -v4f32 = 18, // 4 x f32 -v2f64 = 19, // 2 x f64 +v4f32 = 21, // 4 x f32 +v2f64 = 22, // 2 x f64 LAST_VALUETYPE, // This always remains at the end of the list. }; @@ -96,7 +99,10 @@ case MVT::f32 : case MVT::i32 : return 32; case MVT::f64 : -case MVT::i64 : return 64; +case MVT::i64 : +case MVT::v8i8: +case MVT::v4i16: +case MVT::v2i32:return 64; case MVT::f80 : return 80; case MVT::f128: case MVT::i128: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.14 - 1.15 --- Log message: First chunk of actually generating vector code for packed types. These changes allow us to generate the following code: _foo: li r2, 0 lvx v0, r2, r3 vaddfp v0, v0, v0 stvx v0, r2, r3 blr for this llvm: void %foo(4 x float* %a) { entry: %tmp1 = load 4 x float* %a %tmp2 = add 4 x float %tmp1, %tmp1 store 4 x float %tmp2, 4 x float* %a ret void } --- Diffs of the changes: (+17 -4) ValueTypes.h | 21 + 1 files changed, 17 insertions(+), 4 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.14 llvm/include/llvm/CodeGen/ValueTypes.h:1.15 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.14 Mon Nov 28 23:45:28 2005 +++ llvm/include/llvm/CodeGen/ValueTypes.h Wed Nov 30 02:22:02 2005 @@ -45,10 +45,8 @@ isVoid = 12, // This has no value Vector = 13, // This is an abstract vector type, which will -// be refined into a target vector type, or -// scalarized. - -// These are 128 bit vectors of varying packed types +// be expanded into a target vector type, or scalars +// if no matching vector type is available. v16i8 = 14, // 16 x i8 v8i16 = 15, // 8 x i16 v4i32 = 16, // 4 x i32 @@ -70,6 +68,21 @@ return (VT = v16i8 VT = v2f64); } + /// getVectorType - Returns the ValueType that represents a vector NumElements + /// in length, where each element is of type VT. If there is no ValueType + /// that represents this vector, a ValueType of Other is returned. + /// + static inline ValueType getVectorType(ValueType VT, unsigned NumElements) { +switch (VT) { +default: + break; +case MVT::f32: + if (NumElements == 4) return MVT::v4f32; + break; +} +return MVT::Other; + } + static inline unsigned getSizeInBits(ValueType VT) { switch (VT) { default: assert(0 ValueType has no known size!); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h
Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.13 - 1.14 --- Log message: Add the majority of the vector machien value types we expect to support, and make a few changes to the legalization machinery to support more than 16 types. --- Diffs of the changes: (+21 -3) ValueTypes.h | 24 +--- 1 files changed, 21 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.13 llvm/include/llvm/CodeGen/ValueTypes.h:1.14 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.13 Thu Nov 17 15:44:42 2005 +++ llvm/include/llvm/CodeGen/ValueTypes.h Mon Nov 28 23:45:28 2005 @@ -48,14 +48,26 @@ // be refined into a target vector type, or // scalarized. +// These are 128 bit vectors of varying packed types +v16i8 = 14, // 16 x i8 +v8i16 = 15, // 8 x i16 +v4i32 = 16, // 4 x i32 +v2i64 = 17, // 2 x i64 + +v4f32 = 18, // 4 x f32 +v2f64 = 19, // 2 x f64 + LAST_VALUETYPE, // This always remains at the end of the list. }; static inline bool isInteger(ValueType VT) { -return VT = i1 VT = i128; +return (VT = i1 VT = i128) || (VT = v16i8 VT = v2i64); } static inline bool isFloatingPoint(ValueType VT) { -return VT = f32 VT = f128; +return (VT = f32 VT = f128) || (VT = v4f32 VT = v2f64); + } + static inline bool isVector(ValueType VT) { +return (VT = v16i8 VT = v2f64); } static inline unsigned getSizeInBits(ValueType VT) { @@ -70,7 +82,13 @@ case MVT::i64 : return 64; case MVT::f80 : return 80; case MVT::f128: -case MVT::i128: return 128; +case MVT::i128: +case MVT::v16i8: +case MVT::v8i16: +case MVT::v4i32: +case MVT::v2i64: +case MVT::v4f32: +case MVT::v2f64: return 128; } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits