From 0fe3792a2fd6ed9c20d8bf8eb3689672cb30c1c7 Mon Sep 17 00:00:00 2001 From: Jack Carter Date: Tue, 13 Aug 2013 22:34:26 +0000 Subject: [PATCH] [Mips][msa] Value types for MSA support. Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td, and CodeGenTarget.cpp Patch by Daniel Sanders git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188326 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/ValueTypes.h | 31 +++++++++++++++++------------- include/llvm/CodeGen/ValueTypes.td | 23 +++++++++++----------- lib/IR/ValueTypes.cpp | 2 ++ utils/TableGen/CodeGenTarget.cpp | 1 + 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index b7b3d73b307..f605c80c856 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -94,13 +94,14 @@ namespace llvm { LAST_INTEGER_VECTOR_VALUETYPE = v16i64, v2f16 = 41, // 2 x f16 - v2f32 = 42, // 2 x f32 - v4f32 = 43, // 4 x f32 - v8f32 = 44, // 8 x f32 - v16f32 = 45, // 16 x f32 - v2f64 = 46, // 2 x f64 - v4f64 = 47, // 4 x f64 - v8f64 = 48, // 8 x f64 + v8f16 = 42, // 8 x f16 + v2f32 = 43, // 2 x f32 + v4f32 = 44, // 4 x f32 + v8f32 = 45, // 8 x f32 + v16f32 = 46, // 16 x f32 + v2f64 = 47, // 2 x f64 + v4f64 = 48, // 4 x f64 + v8f64 = 49, // 8 x f64 FIRST_FP_VECTOR_VALUETYPE = v2f16, LAST_FP_VECTOR_VALUETYPE = v8f64, @@ -108,17 +109,17 @@ namespace llvm { FIRST_VECTOR_VALUETYPE = v2i1, 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 // 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. // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors @@ -287,7 +288,8 @@ namespace llvm { case v4i64: case v8i64: case v16i64: return i64; - case v2f16: return f16; + case v2f16: + case v8f16: return f16; case v2f32: case v4f32: case v8f32: @@ -318,6 +320,7 @@ namespace llvm { case v8i16: case v8i32: case v8i64: + case v8f16: case v8f32: case v8f64: return 8; case v4i1: @@ -390,6 +393,7 @@ namespace llvm { case v8i16: case v4i32: case v2i64: + case v8f16: case v4f32: case v2f64: return 128; case v32i8: @@ -521,6 +525,7 @@ namespace llvm { break; case MVT::f16: if (NumElements == 2) return MVT::v2f16; + if (NumElements == 8) return MVT::v8f16; break; case MVT::f32: if (NumElements == 2) return MVT::v2f32; diff --git a/include/llvm/CodeGen/ValueTypes.td b/include/llvm/CodeGen/ValueTypes.td index da269859491..28ad936de81 100644 --- a/include/llvm/CodeGen/ValueTypes.td +++ b/include/llvm/CodeGen/ValueTypes.td @@ -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 v2f16 : ValueType<32 , 41>; // 2 x f16 vector value -def v2f32 : ValueType<64 , 42>; // 2 x f32 vector value -def v4f32 : ValueType<128, 43>; // 4 x f32 vector value -def v8f32 : ValueType<256, 44>; // 8 x f32 vector value -def v16f32 : ValueType<512, 45>; // 16 x f32 vector value -def v2f64 : ValueType<128, 46>; // 2 x f64 vector value -def v4f64 : ValueType<256, 47>; // 4 x f64 vector value -def v8f64 : ValueType<512, 48>; // 8 x f64 vector value +def v8f16 : ValueType<128, 42>; // 8 x f16 vector value +def v2f32 : ValueType<64 , 43>; // 2 x f32 vector value +def v4f32 : ValueType<128, 44>; // 4 x f32 vector value +def v8f32 : ValueType<256, 45>; // 8 x f32 vector value +def v16f32 : ValueType<512, 46>; // 16 x f32 vector value +def v2f64 : ValueType<128, 47>; // 2 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 FlagVT : ValueType<0 , 50>; // Pre-RA sched glue -def isVoid : ValueType<0 , 51>; // Produces no value -def untyped: ValueType<8 , 52>; // Produces an untyped value +def x86mmx : ValueType<64 , 50>; // X86 MMX value +def FlagVT : ValueType<0 , 51>; // Pre-RA sched glue +def isVoid : ValueType<0 , 52>; // Produces no value +def untyped: ValueType<8 , 53>; // Produces an untyped value def MetadataVT: ValueType<0, 250>; // Metadata // Pseudo valuetype mapped to the current pointer size to any address space. diff --git a/lib/IR/ValueTypes.cpp b/lib/IR/ValueTypes.cpp index ba04d60c24a..5aa4d06ffe4 100644 --- a/lib/IR/ValueTypes.cpp +++ b/lib/IR/ValueTypes.cpp @@ -158,6 +158,7 @@ std::string EVT::getEVTString() const { case MVT::v16i64: return "v16i64"; case MVT::v2f32: return "v2f32"; case MVT::v2f16: return "v2f16"; + case MVT::v8f16: return "v8f16"; case MVT::v4f32: return "v4f32"; case MVT::v8f32: return "v8f32"; 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::v16i64: return VectorType::get(Type::getInt64Ty(Context), 16); 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::v4f32: return VectorType::get(Type::getFloatTy(Context), 4); case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8); diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index b2c883da0ed..72fa9ec6774 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -98,6 +98,7 @@ std::string llvm::getEnumName(MVT::SimpleValueType T) { case MVT::v8i64: return "MVT::v8i64"; case MVT::v16i64: return "MVT::v16i64"; case MVT::v2f16: return "MVT::v2f16"; + case MVT::v8f16: return "MVT::v8f16"; case MVT::v2f32: return "MVT::v2f32"; case MVT::v4f32: return "MVT::v4f32"; case MVT::v8f32: return "MVT::v8f32"; -- 2.34.1