Adding a v8i64 512-bit vector type. This will be used to model ARM NEON intrinsics...
authorEvan Cheng <evan.cheng@apple.com>
Thu, 13 May 2010 23:55:47 +0000 (23:55 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 13 May 2010 23:55:47 +0000 (23:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103746 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ValueTypes.h
include/llvm/CodeGen/ValueTypes.td
lib/VMCore/ValueTypes.cpp
utils/TableGen/CodeGenTarget.cpp

index a7aafc0300684251d76a0c513f5cedadc6a87b6c..2d4760d33681bb846ef7b65622b4e68f707d8ae9 100644 (file)
@@ -63,19 +63,20 @@ namespace llvm {
       v1i64          =  24,   //  1 x i64
       v2i64          =  25,   //  2 x i64
       v4i64          =  26,   //  4 x i64
+      v8i64          =  27,   //  8 x i64
 
-      v2f32          =  27,   //  2 x f32
-      v4f32          =  28,   //  4 x f32
-      v8f32          =  29,   //  8 x f32
-      v2f64          =  30,   //  2 x f64
-      v4f64          =  31,   //  4 x f64
+      v2f32          =  28,   //  2 x f32
+      v4f32          =  29,   //  4 x f32
+      v8f32          =  30,   //  8 x f32
+      v2f64          =  31,   //  2 x f64
+      v4f64          =  32,   //  4 x f64
 
       FIRST_VECTOR_VALUETYPE = v2i8,
       LAST_VECTOR_VALUETYPE  = v4f64,
 
-      Flag           =  32,   // This glues nodes together during pre-RA sched
+      Flag           =  33,   // This glues nodes together during pre-RA sched
 
-      isVoid         =  33,   // This has no value
+      isVoid         =  34,   // This has no value
 
       LAST_VALUETYPE =  34,   // This always remains at the end of the list.
 
@@ -140,7 +141,7 @@ namespace llvm {
     bool isInteger() const {
       return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
                SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
-               (SimpleTy >= MVT::v2i8 && SimpleTy <= MVT::v4i64));
+               (SimpleTy >= MVT::v2i8 && SimpleTy <= MVT::v8i64));
     }
 
     /// isVector - Return true if this is a vector value type.
@@ -192,7 +193,8 @@ namespace llvm {
       case v8i32: return i32;
       case v1i64:
       case v2i64:
-      case v4i64: return i64;
+      case v4i64:
+      case v8i64: return i64;
       case v2f32:
       case v4f32:
       case v8f32: return f32;
@@ -211,6 +213,7 @@ namespace llvm {
       case v8i8 :
       case v8i16:
       case v8i32:
+      case v8i64:
       case v8f32: return 8;
       case v4i8:
       case v4i16:
@@ -269,6 +272,7 @@ namespace llvm {
       case v4i64:
       case v8f32:
       case v4f64: return 256;
+      case v8i64: return 512;
       }
     }
     
@@ -332,6 +336,7 @@ namespace llvm {
         if (NumElements == 1)  return MVT::v1i64;
         if (NumElements == 2)  return MVT::v2i64;
         if (NumElements == 4)  return MVT::v4i64;
+        if (NumElements == 8)  return MVT::v8i64;
         break;
       case MVT::f32:
         if (NumElements == 2)  return MVT::v2f32;
@@ -468,10 +473,15 @@ namespace llvm {
 
     /// is256BitVector - Return true if this is a 256-bit vector type.
     inline bool is256BitVector() const {
-      return isSimple() ?
-             (V==MVT::v8f32 || V==MVT::v4f64 || V==MVT::v32i8 ||
-              V==MVT::v16i16 || V==MVT::v8i32 || V==MVT::v4i64) : 
-            isExtended256BitVector();
+      return isSimple()
+        ? (V==MVT::v8f32 || V==MVT::v4f64 || V==MVT::v32i8 ||
+           V==MVT::v16i16 || V==MVT::v8i32 || V==MVT::v4i64)
+        : isExtended256BitVector();
+    }
+
+    /// is512BitVector - Return true if this is a 512-bit vector type.
+    inline bool is512BitVector() const {
+      return isSimple() ? (V == MVT::v8i64) : isExtended512BitVector();
     }
 
     /// isOverloaded - Return true if this is an overloaded type for TableGen.
@@ -668,6 +678,7 @@ namespace llvm {
     bool isExtended64BitVector() const;
     bool isExtended128BitVector() const;
     bool isExtended256BitVector() const;
+    bool isExtended512BitVector() const;
     EVT getExtendedVectorElementType() const;
     unsigned getExtendedVectorNumElements() const;
     unsigned getExtendedSizeInBits() const;
index c8bb7896cd8ff8aec320322a8e8c5e8e60b51fed..8151c0be3664ec32287503be699c65d90efb6ff5 100644 (file)
@@ -47,15 +47,16 @@ def v8i32  : ValueType<256, 23>;   //  8 x i32 vector value
 def v1i64  : ValueType<64 , 24>;   //  1 x i64 vector value
 def v2i64  : ValueType<128, 25>;   //  2 x i64 vector value
 def v4i64  : ValueType<256, 26>;   //  4 x f64 vector value
+def v8i64  : ValueType<512, 27>;   //  4 x f64 vector value
 
-def v2f32  : ValueType<64,  27>;   //  2 x f32 vector value
-def v4f32  : ValueType<128, 28>;   //  4 x f32 vector value
-def v8f32  : ValueType<256, 29>;   //  8 x f32 vector value
-def v2f64  : ValueType<128, 30>;   //  2 x f64 vector value
-def v4f64  : ValueType<256, 31>;   //  4 x f64 vector value
+def v2f32  : ValueType<64,  28>;   //  2 x f32 vector value
+def v4f32  : ValueType<128, 29>;   //  4 x f32 vector value
+def v8f32  : ValueType<256, 30>;   //  8 x f32 vector value
+def v2f64  : ValueType<128, 31>;   //  2 x f64 vector value
+def v4f64  : ValueType<256, 32>;   //  4 x f64 vector value
 
-def FlagVT : ValueType<0  , 32>;   // Pre-RA sched glue
-def isVoid : ValueType<0  , 33>;   // Produces no value
+def FlagVT : ValueType<0  , 33>;   // Pre-RA sched glue
+def isVoid : ValueType<0  , 34>;   // Produces no value
 
 def MetadataVT: ValueType<0, 250>; // Metadata
 
index a092cd1a84b613275aacda093163a5c5649d4adf..d2a8ce34ae479bf61ffae828d17e6671340e7536 100644 (file)
@@ -61,6 +61,10 @@ bool EVT::isExtended256BitVector() const {
   return isExtendedVector() && getSizeInBits() == 256;
 }
 
+bool EVT::isExtended512BitVector() const {
+  return isExtendedVector() && getSizeInBits() == 512;
+}
+
 EVT EVT::getExtendedVectorElementType() const {
   assert(isExtended() && "Type is not extended!");
   return EVT::getEVT(cast<VectorType>(LLVMTy)->getElementType());
@@ -121,6 +125,7 @@ std::string EVT::getEVTString() const {
   case MVT::v1i64:   return "v1i64";
   case MVT::v2i64:   return "v2i64";
   case MVT::v4i64:   return "v4i64";
+  case MVT::v8i64:   return "v8i64";
   case MVT::v2f32:   return "v2f32";
   case MVT::v4f32:   return "v4f32";
   case MVT::v8f32:   return "v8f32";
@@ -165,6 +170,7 @@ const Type *EVT::getTypeForEVT(LLVMContext &Context) const {
   case MVT::v1i64:   return VectorType::get(Type::getInt64Ty(Context), 1);
   case MVT::v2i64:   return VectorType::get(Type::getInt64Ty(Context), 2);
   case MVT::v4i64:   return VectorType::get(Type::getInt64Ty(Context), 4);
+  case MVT::v8i64:   return VectorType::get(Type::getInt64Ty(Context), 8);
   case MVT::v2f32:   return VectorType::get(Type::getFloatTy(Context), 2);
   case MVT::v4f32:   return VectorType::get(Type::getFloatTy(Context), 4);
   case MVT::v8f32:   return VectorType::get(Type::getFloatTy(Context), 8);
index 1efe2ff080d662f6e9e421b0839e9e033634d113..f13f969dd35f3a71f34aa9cc0f086c3d48242036 100644 (file)
@@ -80,6 +80,7 @@ std::string llvm::getEnumName(MVT::SimpleValueType T) {
   case MVT::v1i64: return "MVT::v1i64";
   case MVT::v2i64: return "MVT::v2i64";
   case MVT::v4i64: return "MVT::v4i64";
+  case MVT::v8i64: return "MVT::v8i64";
   case MVT::v2f32: return "MVT::v2f32";
   case MVT::v4f32: return "MVT::v4f32";
   case MVT::v8f32: return "MVT::v8f32";