(original) (raw)
Index: include/llvm/CodeGen/ValueTypes.h =================================================================== --- include/llvm/CodeGen/ValueTypes.h (revision 160900) +++ include/llvm/CodeGen/ValueTypes.h (working copy) @@ -61,26 +61,28 @@ v8i8 = 15, // 8 x i8 v16i8 = 16, // 16 x i8 v32i8 = 17, // 32 x i8 - v2i16 = 18, // 2 x i16 - v4i16 = 19, // 4 x i16 - v8i16 = 20, // 8 x i16 - v16i16 = 21, // 16 x i16 - v2i32 = 22, // 2 x i32 - v4i32 = 23, // 4 x i32 - v8i32 = 24, // 8 x i32 - v16i32 = 25, // 16 x i32 - v1i64 = 26, // 1 x i64 - v2i64 = 27, // 2 x i64 - v4i64 = 28, // 4 x i64 - v8i64 = 29, // 8 x i64 - v16i64 = 30, // 16 x i64 + v1i16 = 18, // 1 x i16 + v2i16 = 19, // 2 x i16 + v4i16 = 20, // 4 x i16 + v8i16 = 21, // 8 x i16 + v16i16 = 22, // 16 x i16 + v1i32 = 23, // 1 x i32 + v2i32 = 24, // 2 x i32 + v4i32 = 25, // 4 x i32 + v8i32 = 26, // 8 x i32 + v16i32 = 27, // 16 x i32 + v1i64 = 28, // 1 x i64 + v2i64 = 29, // 2 x i64 + v4i64 = 30, // 4 x i64 + v8i64 = 31, // 8 x i64 + v16i64 = 32, // 16 x i64 - v2f16 = 31, // 2 x f16 - v2f32 = 32, // 2 x f32 - v4f32 = 33, // 4 x f32 - v8f32 = 34, // 8 x f32 - v2f64 = 35, // 2 x f64 - v4f64 = 36, // 4 x f64 + v2f16 = 33, // 2 x f16 + v2f32 = 34, // 2 x f32 + v4f32 = 35, // 4 x f32 + v8f32 = 36, // 8 x f32 + v2f64 = 37, // 2 x f64 + v4f64 = 38, // 4 x f64 FIRST_VECTOR_VALUETYPE = v2i8, LAST_VECTOR_VALUETYPE = v4f64, @@ -89,17 +91,17 @@ FIRST_FP_VECTOR_VALUETYPE = v2f16, LAST_FP_VECTOR_VALUETYPE = v4f64, - x86mmx = 37, // This is an X86 MMX value + x86mmx = 39, // This is an X86 MMX value - Glue = 38, // This glues nodes together during pre-RA sched + Glue = 40, // This glues nodes together during pre-RA sched - isVoid = 39, // This has no value + isVoid = 41, // This has no value - Untyped = 40, // This value takes a register, but has + Untyped = 42, // This value takes a register, but has // unspecified type. The register class // will be determined by the opcode. - LAST_VALUETYPE = 41, // This always remains at the end of the list. + LAST_VALUETYPE = 43, // This always remains at the end of the list. // This is the current maximum for LAST_VALUETYPE. // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors @@ -207,10 +209,12 @@ case v8i8 : case v16i8: case v32i8: return i8; + case v1i16: case v2i16: case v4i16: case v8i16: case v16i16: return i16; + case v1i32: case v2i32: case v4i32: case v8i32: @@ -256,6 +260,8 @@ case v2f16: case v2f32: case v2f64: return 2; + case v1i16: + case v1i32: case v1i64: return 1; } } @@ -274,12 +280,14 @@ case i8 : return 8; case i16 : case f16: - case v2i8: return 16; + case v2i8: + case v1i16: return 16; case f32 : case i32 : case v4i8: case v2i16: - case v2f16: return 32; + case v2f16: + case v1i32: return 32; case x86mmx: case f64 : case i64 : @@ -370,12 +378,14 @@ if (NumElements == 32) return MVT::v32i8; break; case MVT::i16: + if (NumElements == 1) return MVT::v1i16; if (NumElements == 2) return MVT::v2i16; if (NumElements == 4) return MVT::v4i16; if (NumElements == 8) return MVT::v8i16; if (NumElements == 16) return MVT::v16i16; break; case MVT::i32: + if (NumElements == 1) return MVT::v1i32; if (NumElements == 2) return MVT::v2i32; if (NumElements == 4) return MVT::v4i32; if (NumElements == 8) return MVT::v8i32; @@ -498,6 +508,22 @@ return isSimple() ? V.isVector() : isExtendedVector(); } + /// is16BitVector - Return true if this is a 16-bit vector type. + bool is16BitVector() const { + if (!isSimple()) + return isExtended16BitVector(); + + return (V == MVT::v2i8 || V==MVT::v1i16); + } + + /// is32BitVector - Return true if this is a 32-bit vector type. + bool is32BitVector() const { + if (!isSimple()) + return isExtended32BitVector(); + + return (V == MVT::v4i8 || V==MVT::v2i16 || V==MVT::v1i32); + } + /// is64BitVector - Return true if this is a 64-bit vector type. bool is64BitVector() const { if (!isSimple()) @@ -720,6 +746,8 @@ bool isExtendedFloatingPoint() const; bool isExtendedInteger() const; bool isExtendedVector() const; + bool isExtended16BitVector() const; + bool isExtended32BitVector() const; bool isExtended64BitVector() const; bool isExtended128BitVector() const; bool isExtended256BitVector() const; Index: include/llvm/CodeGen/ValueTypes.td =================================================================== --- include/llvm/CodeGen/ValueTypes.td (revision 160900) +++ include/llvm/CodeGen/ValueTypes.td (working copy) @@ -38,31 +38,33 @@ def v8i8 : ValueType<64 , 15>; // 8 x i8 vector value def v16i8 : ValueType<128, 16>; // 16 x i8 vector value def v32i8 : ValueType<256, 17>; // 32 x i8 vector value -def v2i16 : ValueType<32 , 18>; // 2 x i16 vector value -def v4i16 : ValueType<64 , 19>; // 4 x i16 vector value -def v8i16 : ValueType<128, 20>; // 8 x i16 vector value -def v16i16 : ValueType<256, 21>; // 16 x i16 vector value -def v2i32 : ValueType<64 , 22>; // 2 x i32 vector value -def v4i32 : ValueType<128, 23>; // 4 x i32 vector value -def v8i32 : ValueType<256, 24>; // 8 x i32 vector value -def v16i32 : ValueType<512, 25>; // 16 x i32 vector value -def v1i64 : ValueType<64 , 26>; // 1 x i64 vector value -def v2i64 : ValueType<128, 27>; // 2 x i64 vector value -def v4i64 : ValueType<256, 28>; // 4 x i64 vector value -def v8i64 : ValueType<512, 29>; // 8 x i64 vector value -def v16i64 : ValueType<1024,30>; // 16 x i64 vector value +def v1i16 : ValueType<16 , 18>; // 1 x i16 vector value +def v2i16 : ValueType<32 , 19>; // 2 x i16 vector value +def v4i16 : ValueType<64 , 20>; // 4 x i16 vector value +def v8i16 : ValueType<128, 21>; // 8 x i16 vector value +def v16i16 : ValueType<256, 22>; // 16 x i16 vector value +def v1i32 : ValueType<32 , 23>; // 1 x i32 vector value +def v2i32 : ValueType<64 , 24>; // 2 x i32 vector value +def v4i32 : ValueType<128, 25>; // 4 x i32 vector value +def v8i32 : ValueType<256, 26>; // 8 x i32 vector value +def v16i32 : ValueType<512, 27>; // 16 x i32 vector value +def v1i64 : ValueType<64 , 28>; // 1 x i64 vector value +def v2i64 : ValueType<128, 29>; // 2 x i64 vector value +def v4i64 : ValueType<256, 30>; // 4 x i64 vector value +def v8i64 : ValueType<512, 31>; // 8 x i64 vector value +def v16i64 : ValueType<1024,32>; // 16 x i64 vector value -def v2f16 : ValueType<32 , 31>; // 2 x f16 vector value -def v2f32 : ValueType<64 , 32>; // 2 x f32 vector value -def v4f32 : ValueType<128, 33>; // 4 x f32 vector value -def v8f32 : ValueType<256, 34>; // 8 x f32 vector value -def v2f64 : ValueType<128, 35>; // 2 x f64 vector value -def v4f64 : ValueType<256, 36>; // 4 x f64 vector value +def v2f16 : ValueType<32 , 33>; // 2 x f16 vector value +def v2f32 : ValueType<64 , 34>; // 2 x f32 vector value +def v4f32 : ValueType<128, 35>; // 4 x f32 vector value +def v8f32 : ValueType<256, 36>; // 8 x f32 vector value +def v2f64 : ValueType<128, 37>; // 2 x f64 vector value +def v4f64 : ValueType<256, 38>; // 4 x f64 vector value -def x86mmx : ValueType<64 , 37>; // X86 MMX value -def FlagVT : ValueType<0 , 38>; // Pre-RA sched glue -def isVoid : ValueType<0 , 39>; // Produces no value -def untyped: ValueType<8 , 40>; // Produces an untyped value +def x86mmx : ValueType<64 , 39>; // X86 MMX value +def FlagVT : ValueType<0 , 30>; // Pre-RA sched glue +def isVoid : ValueType<0 , 41>; // Produces no value +def untyped: ValueType<8 , 42>; // Produces an untyped value def MetadataVT: ValueType<0, 250>; // Metadata Index: include/llvm/Intrinsics.td =================================================================== --- include/llvm/Intrinsics.td (revision 160900) +++ include/llvm/Intrinsics.td (working copy) @@ -126,10 +126,12 @@ def llvm_v8i8_ty : LLVMType; // 8 x i8 def llvm_v16i8_ty : LLVMType; // 16 x i8 def llvm_v32i8_ty : LLVMType; // 32 x i8 +def llvm_v1i16_ty : LLVMType; // 1 x i16 def llvm_v2i16_ty : LLVMType; // 2 x i16 def llvm_v4i16_ty : LLVMType; // 4 x i16 def llvm_v8i16_ty : LLVMType; // 8 x i16 def llvm_v16i16_ty : LLVMType; // 16 x i16 +def llvm_v1i32_ty : LLVMType; // 1 x i32 def llvm_v2i32_ty : LLVMType; // 2 x i32 def llvm_v4i32_ty : LLVMType; // 4 x i32 def llvm_v8i32_ty : LLVMType; // 8 x i32 Index: lib/VMCore/ValueTypes.cpp =================================================================== --- lib/VMCore/ValueTypes.cpp (revision 160900) +++ lib/VMCore/ValueTypes.cpp (working copy) @@ -55,6 +55,14 @@ return LLVMTy->isVectorTy(); } +bool EVT::isExtended16BitVector() const { + return isExtendedVector() && getSizeInBits() == 16; +} + +bool EVT::isExtended32BitVector() const { + return isExtendedVector() && getSizeInBits() == 32; +} + bool EVT::isExtended64BitVector() const { return isExtendedVector() && getSizeInBits() == 64; }