Adding a v8i64 512-bit vector type. This will be used to model ARM NEON intrinsics which translate into a pair of vld / vst instructions that can load / store 8 consecutive 64-bit (D) registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103746 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2010-05-13 23:55:47 +00:00
parent a5afa1cb21
commit dbf67fefea
4 changed files with 39 additions and 20 deletions

View 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;

View 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

View 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);

View 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";