diff options
author | Christopher Lamb <christopher.lamb@gmail.com> | 2007-07-26 01:46:52 +0000 |
---|---|---|
committer | Christopher Lamb <christopher.lamb@gmail.com> | 2007-07-26 01:46:52 +0000 |
commit | f2bedf6dc3ec3c2a3078c4d922dc7e8b23373561 (patch) | |
tree | 2d48bbc0230fef81972b3de97f95cc050edc2ac2 | |
parent | b7d91493b0e3cf1c33dfc484263285e00856d100 (diff) | |
download | external_llvm-f2bedf6dc3ec3c2a3078c4d922dc7e8b23373561.zip external_llvm-f2bedf6dc3ec3c2a3078c4d922dc7e8b23373561.tar.gz external_llvm-f2bedf6dc3ec3c2a3078c4d922dc7e8b23373561.tar.bz2 |
Add support for 3 element 32-bit vector ValueTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40506 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 24 | ||||
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.td | 13 | ||||
-rw-r--r-- | lib/VMCore/ValueTypes.cpp | 4 |
3 files changed, 30 insertions, 11 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index d2a6414..57826ad 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -52,16 +52,19 @@ namespace MVT { // MVT = Machine Value Types 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 + v3i32 = 19, // 3 x i32 + v4i32 = 20, // 4 x i32 + v2i64 = 21, // 2 x i64 - v2f32 = 21, // 2 x f32 - v4f32 = 22, // 4 x f32 - v2f64 = 23, // 2 x f64 + v2f32 = 22, // 2 x f32 + v3f32 = 23, // 3 x f32 + v4f32 = 24, // 4 x f32 + v2f64 = 25, // 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 = 26, // 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 @@ -133,10 +136,12 @@ namespace MVT { // MVT = Machine Value Types case v4i16: case v8i16: return i16; case v2i32: + case v3i32: case v4i32: return i32; case v1i64: case v2i64: return i64; case v2f32: + case v3f32: case v4f32: return f32; case v2f64: return f64; } @@ -156,6 +161,8 @@ namespace MVT { // MVT = Machine Value Types case v4i16: case v4i32: case v4f32: return 4; + case v3i32: + case v3f32: return 3; case v2i32: case v2i64: case v2f32: @@ -187,6 +194,8 @@ namespace MVT { // MVT = Machine Value Types case MVT::v1i64: case MVT::v2f32: return 64; case MVT::f80 : return 80; + case MVT::v3i32: + case MVT::v3f32: return 96; case MVT::f128: case MVT::i128: case MVT::v16i8: @@ -215,6 +224,7 @@ namespace MVT { // MVT = Machine Value Types break; case MVT::i32: if (NumElements == 2) return MVT::v2i32; + if (NumElements == 3) return MVT::v3i32; if (NumElements == 4) return MVT::v4i32; break; case MVT::i64: @@ -223,6 +233,7 @@ namespace MVT { // MVT = Machine Value Types break; case MVT::f32: if (NumElements == 2) return MVT::v2f32; + if (NumElements == 3) return MVT::v3f32; if (NumElements == 4) return MVT::v4f32; break; case MVT::f64: @@ -244,6 +255,7 @@ namespace MVT { // MVT = Machine Value Types default: return getVectorType(i8, NumElts); case 1: return v1i64; case 2: return v2i32; + case 3: return v3i32; case 4: return v4i16; case 8: return v8i8; case 16: return v16i8; diff --git a/include/llvm/CodeGen/ValueTypes.td b/include/llvm/CodeGen/ValueTypes.td index 557a02b..8e7bca7 100644 --- a/include/llvm/CodeGen/ValueTypes.td +++ b/include/llvm/CodeGen/ValueTypes.td @@ -39,11 +39,14 @@ def v1i64 : ValueType<64 , 16>; // 1 x i64 vector value def v16i8 : ValueType<128, 17>; // 16 x i8 vector value def v8i16 : ValueType<128, 18>; // 8 x i16 vector value -def v4i32 : ValueType<128, 19>; // 4 x i32 vector value -def v2i64 : ValueType<128, 20>; // 2 x i64 vector value -def v2f32 : ValueType<64, 21>; // 2 x f32 vector value -def v4f32 : ValueType<128, 22>; // 4 x f32 vector value -def v2f64 : ValueType<128, 23>; // 2 x f64 vector value +def v3i32 : ValueType<96 , 19>; // 3 x f32 vector value +def v4i32 : ValueType<128, 20>; // 4 x i32 vector value +def v2i64 : ValueType<128, 21>; // 2 x i64 vector value + +def v2f32 : ValueType<64, 22>; // 2 x f32 vector value +def v3f32 : ValueType<96 , 23>; // 3 x f64 vector value +def v4f32 : ValueType<128, 24>; // 4 x f32 vector value +def v2f64 : ValueType<128, 25>; // 2 x f64 vector value // Pseudo valuetype to represent "integer of any bit width" def iAny : ValueType<0 , 254>; // integer value of any bit width diff --git a/lib/VMCore/ValueTypes.cpp b/lib/VMCore/ValueTypes.cpp index 0518aa2..3ea33ce 100644 --- a/lib/VMCore/ValueTypes.cpp +++ b/lib/VMCore/ValueTypes.cpp @@ -50,6 +50,8 @@ std::string MVT::getValueTypeString(MVT::ValueType VT) { case MVT::v2f32: return "v2f32"; case MVT::v4f32: return "v4f32"; case MVT::v2f64: return "v2f64"; + case MVT::v3i32: return "v3i32"; + case MVT::v3f32: return "v3f32"; } } @@ -83,6 +85,8 @@ const Type *MVT::getTypeForValueType(MVT::ValueType VT) { case MVT::v2f32: return VectorType::get(Type::FloatTy, 2); case MVT::v4f32: return VectorType::get(Type::FloatTy, 4); case MVT::v2f64: return VectorType::get(Type::DoubleTy, 2); + case MVT::v3i32: return VectorType::get(Type::Int32Ty, 3); + case MVT::v3f32: return VectorType::get(Type::FloatTy, 3); } } |