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
+ 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 = 22, // 2 x f32
- v4f32 = 23, // 4 x f32
- v2f64 = 24, // 2 x f64
+ 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
/// 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;
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) {
- return VT & ~SimpleTypeMask;
+ static inline bool isExtendedVT(ValueType VT) {
+ return VT > SimpleTypeMask;
}
/// MVT::isInteger - Return true if this is an integer, or a vector integer
/// 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
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 :
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;
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!");