summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-12-20 00:02:33 +0000
committerDan Gohman <gohman@apple.com>2011-12-20 00:02:33 +0000
commite3376ecd504300ae529c902135f51baffbdc2824 (patch)
tree4c961d5b28a0b323e77dae5450bd8154cb53fb18 /include
parent9b0878512fb57ee4b0bc483509e4d9f4f0b9e426 (diff)
downloadllvm-e3376ecd504300ae529c902135f51baffbdc2824.tar.gz
llvm-e3376ecd504300ae529c902135f51baffbdc2824.tar.bz2
llvm-e3376ecd504300ae529c902135f51baffbdc2824.tar.xz
Add basic generic CodeGen support for half.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h72
-rw-r--r--include/llvm/CodeGen/ValueTypes.td61
2 files changed, 69 insertions, 64 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index 7a7080f28f..de9aacd2a5 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -45,49 +45,50 @@ namespace llvm {
FIRST_INTEGER_VALUETYPE = i1,
LAST_INTEGER_VALUETYPE = i128,
- f32 = 7, // This is a 32 bit floating point value
- f64 = 8, // This is a 64 bit floating point value
- f80 = 9, // This is a 80 bit floating point value
- f128 = 10, // This is a 128 bit floating point value
- ppcf128 = 11, // This is a PPC 128-bit floating point value
-
- v2i8 = 12, // 2 x i8
- v4i8 = 13, // 4 x i8
- v8i8 = 14, // 8 x i8
- v16i8 = 15, // 16 x i8
- v32i8 = 16, // 32 x i8
- v2i16 = 17, // 2 x i16
- v4i16 = 18, // 4 x i16
- v8i16 = 19, // 8 x i16
- v16i16 = 20, // 16 x i16
- v2i32 = 21, // 2 x i32
- v4i32 = 22, // 4 x i32
- v8i32 = 23, // 8 x i32
- v1i64 = 24, // 1 x i64
- v2i64 = 25, // 2 x i64
- v4i64 = 26, // 4 x i64
- v8i64 = 27, // 8 x i64
-
- 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
+ f16 = 7, // This is a 16 bit floating point value
+ f32 = 8, // This is a 32 bit floating point value
+ f64 = 9, // This is a 64 bit floating point value
+ f80 = 10, // This is a 80 bit floating point value
+ f128 = 11, // This is a 128 bit floating point value
+ ppcf128 = 12, // This is a PPC 128-bit floating point value
+
+ v2i8 = 13, // 2 x i8
+ v4i8 = 14, // 4 x i8
+ v8i8 = 15, // 8 x i8
+ v16i8 = 16, // 16 x i8
+ v32i8 = 17, // 32 x i8
+ v2i16 = 18, // 2 x i16
+ v4i16 = 19, // 4 x i16
+ v8i16 = 20, // 8 x i16
+ v16i16 = 21, // 16 x i16
+ v2i32 = 22, // 2 x i32
+ v4i32 = 23, // 4 x i32
+ v8i32 = 24, // 8 x i32
+ v1i64 = 25, // 1 x i64
+ v2i64 = 26, // 2 x i64
+ v4i64 = 27, // 4 x i64
+ v8i64 = 28, // 8 x i64
+
+ v2f32 = 29, // 2 x f32
+ v4f32 = 30, // 4 x f32
+ v8f32 = 31, // 8 x f32
+ v2f64 = 32, // 2 x f64
+ v4f64 = 33, // 4 x f64
FIRST_VECTOR_VALUETYPE = v2i8,
LAST_VECTOR_VALUETYPE = v4f64,
- x86mmx = 33, // This is an X86 MMX value
+ x86mmx = 34, // This is an X86 MMX value
- Glue = 34, // This glues nodes together during pre-RA sched
+ Glue = 35, // This glues nodes together during pre-RA sched
- isVoid = 35, // This has no value
+ isVoid = 36, // This has no value
- Untyped = 36, // This value takes a register, but has
+ Untyped = 37, // This value takes a register, but has
// unspecified type. The register class
// will be determined by the opcode.
- LAST_VALUETYPE = 37, // This always remains at the end of the list.
+ LAST_VALUETYPE = 38, // 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
@@ -143,7 +144,7 @@ namespace llvm {
/// isFloatingPoint - Return true if this is a FP, or a vector FP type.
bool isFloatingPoint() const {
- return ((SimpleTy >= MVT::f32 && SimpleTy <= MVT::ppcf128) ||
+ return ((SimpleTy >= MVT::f16 && SimpleTy <= MVT::ppcf128) ||
(SimpleTy >= MVT::v2f32 && SimpleTy <= MVT::v4f64));
}
@@ -252,6 +253,7 @@ namespace llvm {
case i1 : return 1;
case i8 : return 8;
case i16 :
+ case f16:
case v2i8: return 16;
case f32 :
case i32 :
@@ -301,6 +303,8 @@ namespace llvm {
switch (BitWidth) {
default:
assert(false && "Bad bit width!");
+ case 16:
+ return MVT::f16;
case 32:
return MVT::f32;
case 64:
diff --git a/include/llvm/CodeGen/ValueTypes.td b/include/llvm/CodeGen/ValueTypes.td
index 0cfb634ead..482f84771c 100644
--- a/include/llvm/CodeGen/ValueTypes.td
+++ b/include/llvm/CodeGen/ValueTypes.td
@@ -26,39 +26,40 @@ def i16 : ValueType<16 , 3>; // 16-bit integer value
def i32 : ValueType<32 , 4>; // 32-bit integer value
def i64 : ValueType<64 , 5>; // 64-bit integer value
def i128 : ValueType<128, 6>; // 128-bit integer value
-def f32 : ValueType<32 , 7>; // 32-bit floating point value
-def f64 : ValueType<64 , 8>; // 64-bit floating point value
-def f80 : ValueType<80 , 9>; // 80-bit floating point value
-def f128 : ValueType<128, 10>; // 128-bit floating point value
-def ppcf128: ValueType<128, 11>; // PPC 128-bit floating point value
+def f16 : ValueType<16 , 7>; // 32-bit floating point value
+def f32 : ValueType<32 , 8>; // 32-bit floating point value
+def f64 : ValueType<64 , 9>; // 64-bit floating point value
+def f80 : ValueType<80 , 10>; // 80-bit floating point value
+def f128 : ValueType<128, 11>; // 128-bit floating point value
+def ppcf128: ValueType<128, 12>; // PPC 128-bit floating point value
-def v2i8 : ValueType<16 , 12>; // 2 x i8 vector value
-def v4i8 : ValueType<32 , 13>; // 4 x i8 vector value
-def v8i8 : ValueType<64 , 14>; // 8 x i8 vector value
-def v16i8 : ValueType<128, 15>; // 16 x i8 vector value
-def v32i8 : ValueType<256, 16>; // 32 x i8 vector value
-def v2i16 : ValueType<32 , 17>; // 2 x i16 vector value
-def v4i16 : ValueType<64 , 18>; // 4 x i16 vector value
-def v8i16 : ValueType<128, 19>; // 8 x i16 vector value
-def v16i16 : ValueType<256, 20>; // 16 x i16 vector value
-def v2i32 : ValueType<64 , 21>; // 2 x i32 vector value
-def v4i32 : ValueType<128, 22>; // 4 x i32 vector value
-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 i64 vector value
-def v8i64 : ValueType<512, 27>; // 8 x i64 vector value
+def v2i8 : ValueType<16 , 13>; // 2 x i8 vector value
+def v4i8 : ValueType<32 , 14>; // 4 x i8 vector value
+def v8i8 : ValueType<64 , 15>; // 8 x i8 vector value
+def v16i8 : ValueType<128, 16>; // 16 x i8 vector value
+def v32i8 : ValueType<256, 17>; // 32 x i8 vector value
+def v2i16 : ValueType<32 , 18>; // 2 x i16 vector value
+def v4i16 : ValueType<64 , 19>; // 4 x i16 vector value
+def v8i16 : ValueType<128, 20>; // 8 x i16 vector value
+def v16i16 : ValueType<256, 21>; // 16 x i16 vector value
+def v2i32 : ValueType<64 , 22>; // 2 x i32 vector value
+def v4i32 : ValueType<128, 23>; // 4 x i32 vector value
+def v8i32 : ValueType<256, 24>; // 8 x i32 vector value
+def v1i64 : ValueType<64 , 25>; // 1 x i64 vector value
+def v2i64 : ValueType<128, 26>; // 2 x i64 vector value
+def v4i64 : ValueType<256, 27>; // 4 x i64 vector value
+def v8i64 : ValueType<512, 28>; // 8 x i64 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 v2f32 : ValueType<64 , 29>; // 2 x f32 vector value
+def v4f32 : ValueType<128, 30>; // 4 x f32 vector value
+def v8f32 : ValueType<256, 31>; // 8 x f32 vector value
+def v2f64 : ValueType<128, 32>; // 2 x f64 vector value
+def v4f64 : ValueType<256, 33>; // 4 x f64 vector value
-def x86mmx : ValueType<64 , 33>; // X86 MMX value
-def FlagVT : ValueType<0 , 34>; // Pre-RA sched glue
-def isVoid : ValueType<0 , 35>; // Produces no value
-def untyped: ValueType<8 , 36>; // Produces an untyped value
+def x86mmx : ValueType<64 , 34>; // X86 MMX value
+def FlagVT : ValueType<0 , 35>; // Pre-RA sched glue
+def isVoid : ValueType<0 , 36>; // Produces no value
+def untyped: ValueType<8 , 37>; // Produces an untyped value
def MetadataVT: ValueType<0, 250>; // Metadata