[Mips][msa] Value types for MSA support.

Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td, 
and CodeGenTarget.cpp

Patch by Daniel Sanders

llvm-svn: 188326
This commit is contained in:
Jack Carter 2013-08-13 22:34:26 +00:00
parent bbd6db8032
commit 52f2bea0d3
4 changed files with 33 additions and 24 deletions

View File

@ -94,13 +94,14 @@ namespace llvm {
LAST_INTEGER_VECTOR_VALUETYPE = v16i64, LAST_INTEGER_VECTOR_VALUETYPE = v16i64,
v2f16 = 41, // 2 x f16 v2f16 = 41, // 2 x f16
v2f32 = 42, // 2 x f32 v8f16 = 42, // 8 x f16
v4f32 = 43, // 4 x f32 v2f32 = 43, // 2 x f32
v8f32 = 44, // 8 x f32 v4f32 = 44, // 4 x f32
v16f32 = 45, // 16 x f32 v8f32 = 45, // 8 x f32
v2f64 = 46, // 2 x f64 v16f32 = 46, // 16 x f32
v4f64 = 47, // 4 x f64 v2f64 = 47, // 2 x f64
v8f64 = 48, // 8 x f64 v4f64 = 48, // 4 x f64
v8f64 = 49, // 8 x f64
FIRST_FP_VECTOR_VALUETYPE = v2f16, FIRST_FP_VECTOR_VALUETYPE = v2f16,
LAST_FP_VECTOR_VALUETYPE = v8f64, LAST_FP_VECTOR_VALUETYPE = v8f64,
@ -108,17 +109,17 @@ namespace llvm {
FIRST_VECTOR_VALUETYPE = v2i1, FIRST_VECTOR_VALUETYPE = v2i1,
LAST_VECTOR_VALUETYPE = v8f64, LAST_VECTOR_VALUETYPE = v8f64,
x86mmx = 49, // This is an X86 MMX value x86mmx = 50, // This is an X86 MMX value
Glue = 50, // This glues nodes together during pre-RA sched Glue = 51, // This glues nodes together during pre-RA sched
isVoid = 51, // This has no value isVoid = 52, // This has no value
Untyped = 52, // This value takes a register, but has Untyped = 53, // This value takes a register, but has
// unspecified type. The register class // unspecified type. The register class
// will be determined by the opcode. // will be determined by the opcode.
LAST_VALUETYPE = 53, // This always remains at the end of the list. LAST_VALUETYPE = 54, // This always remains at the end of the list.
// This is the current maximum for LAST_VALUETYPE. // This is the current maximum for LAST_VALUETYPE.
// MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
@ -287,7 +288,8 @@ namespace llvm {
case v4i64: case v4i64:
case v8i64: case v8i64:
case v16i64: return i64; case v16i64: return i64;
case v2f16: return f16; case v2f16:
case v8f16: return f16;
case v2f32: case v2f32:
case v4f32: case v4f32:
case v8f32: case v8f32:
@ -318,6 +320,7 @@ namespace llvm {
case v8i16: case v8i16:
case v8i32: case v8i32:
case v8i64: case v8i64:
case v8f16:
case v8f32: case v8f32:
case v8f64: return 8; case v8f64: return 8;
case v4i1: case v4i1:
@ -390,6 +393,7 @@ namespace llvm {
case v8i16: case v8i16:
case v4i32: case v4i32:
case v2i64: case v2i64:
case v8f16:
case v4f32: case v4f32:
case v2f64: return 128; case v2f64: return 128;
case v32i8: case v32i8:
@ -521,6 +525,7 @@ namespace llvm {
break; break;
case MVT::f16: case MVT::f16:
if (NumElements == 2) return MVT::v2f16; if (NumElements == 2) return MVT::v2f16;
if (NumElements == 8) return MVT::v8f16;
break; break;
case MVT::f32: case MVT::f32:
if (NumElements == 2) return MVT::v2f32; if (NumElements == 2) return MVT::v2f32;

View File

@ -63,19 +63,20 @@ def v8i64 : ValueType<512, 39>; // 8 x i64 vector value
def v16i64 : ValueType<1024,40>; // 16 x i64 vector value def v16i64 : ValueType<1024,40>; // 16 x i64 vector value
def v2f16 : ValueType<32 , 41>; // 2 x f16 vector value def v2f16 : ValueType<32 , 41>; // 2 x f16 vector value
def v2f32 : ValueType<64 , 42>; // 2 x f32 vector value def v8f16 : ValueType<128, 42>; // 8 x f16 vector value
def v4f32 : ValueType<128, 43>; // 4 x f32 vector value def v2f32 : ValueType<64 , 43>; // 2 x f32 vector value
def v8f32 : ValueType<256, 44>; // 8 x f32 vector value def v4f32 : ValueType<128, 44>; // 4 x f32 vector value
def v16f32 : ValueType<512, 45>; // 16 x f32 vector value def v8f32 : ValueType<256, 45>; // 8 x f32 vector value
def v2f64 : ValueType<128, 46>; // 2 x f64 vector value def v16f32 : ValueType<512, 46>; // 16 x f32 vector value
def v4f64 : ValueType<256, 47>; // 4 x f64 vector value def v2f64 : ValueType<128, 47>; // 2 x f64 vector value
def v8f64 : ValueType<512, 48>; // 8 x f64 vector value def v4f64 : ValueType<256, 48>; // 4 x f64 vector value
def v8f64 : ValueType<512, 49>; // 8 x f64 vector value
def x86mmx : ValueType<64 , 49>; // X86 MMX value def x86mmx : ValueType<64 , 50>; // X86 MMX value
def FlagVT : ValueType<0 , 50>; // Pre-RA sched glue def FlagVT : ValueType<0 , 51>; // Pre-RA sched glue
def isVoid : ValueType<0 , 51>; // Produces no value def isVoid : ValueType<0 , 52>; // Produces no value
def untyped: ValueType<8 , 52>; // Produces an untyped value def untyped: ValueType<8 , 53>; // Produces an untyped value
def MetadataVT: ValueType<0, 250>; // Metadata def MetadataVT: ValueType<0, 250>; // Metadata
// Pseudo valuetype mapped to the current pointer size to any address space. // Pseudo valuetype mapped to the current pointer size to any address space.

View File

@ -158,6 +158,7 @@ std::string EVT::getEVTString() const {
case MVT::v16i64: return "v16i64"; case MVT::v16i64: return "v16i64";
case MVT::v2f32: return "v2f32"; case MVT::v2f32: return "v2f32";
case MVT::v2f16: return "v2f16"; case MVT::v2f16: return "v2f16";
case MVT::v8f16: return "v8f16";
case MVT::v4f32: return "v4f32"; case MVT::v4f32: return "v4f32";
case MVT::v8f32: return "v8f32"; case MVT::v8f32: return "v8f32";
case MVT::v16f32: return "v16f32"; case MVT::v16f32: return "v16f32";
@ -220,6 +221,7 @@ Type *EVT::getTypeForEVT(LLVMContext &Context) const {
case MVT::v8i64: return VectorType::get(Type::getInt64Ty(Context), 8); case MVT::v8i64: return VectorType::get(Type::getInt64Ty(Context), 8);
case MVT::v16i64: return VectorType::get(Type::getInt64Ty(Context), 16); case MVT::v16i64: return VectorType::get(Type::getInt64Ty(Context), 16);
case MVT::v2f16: return VectorType::get(Type::getHalfTy(Context), 2); case MVT::v2f16: return VectorType::get(Type::getHalfTy(Context), 2);
case MVT::v8f16: return VectorType::get(Type::getHalfTy(Context), 8);
case MVT::v2f32: return VectorType::get(Type::getFloatTy(Context), 2); case MVT::v2f32: return VectorType::get(Type::getFloatTy(Context), 2);
case MVT::v4f32: return VectorType::get(Type::getFloatTy(Context), 4); case MVT::v4f32: return VectorType::get(Type::getFloatTy(Context), 4);
case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8); case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8);

View File

@ -98,6 +98,7 @@ std::string llvm::getEnumName(MVT::SimpleValueType T) {
case MVT::v8i64: return "MVT::v8i64"; case MVT::v8i64: return "MVT::v8i64";
case MVT::v16i64: return "MVT::v16i64"; case MVT::v16i64: return "MVT::v16i64";
case MVT::v2f16: return "MVT::v2f16"; case MVT::v2f16: return "MVT::v2f16";
case MVT::v8f16: return "MVT::v8f16";
case MVT::v2f32: return "MVT::v2f32"; case MVT::v2f32: return "MVT::v2f32";
case MVT::v4f32: return "MVT::v4f32"; case MVT::v4f32: return "MVT::v4f32";
case MVT::v8f32: return "MVT::v8f32"; case MVT::v8f32: return "MVT::v8f32";