OLD | NEW |
1 //===- subzero/src/IceTypes.cpp - Primitive type properties ---------------===// | 1 //===- subzero/src/IceTypes.cpp - Primitive type properties ---------------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines a few attributes of Subzero primitive types. | 10 // This file defines a few attributes of Subzero primitive types. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 size_t TypeAlignInBytes; | 85 size_t TypeAlignInBytes; |
86 size_t TypeNumElements; | 86 size_t TypeNumElements; |
87 Type TypeElementType; | 87 Type TypeElementType; |
88 const char *DisplayString; | 88 const char *DisplayString; |
89 }; | 89 }; |
90 | 90 |
91 const struct TypeAttributeFields TypeAttributes[] = { | 91 const struct TypeAttributeFields TypeAttributes[] = { |
92 #define X(tag, size, align, elts, elty, str) \ | 92 #define X(tag, size, align, elts, elty, str) \ |
93 { size, align, elts, elty, str } \ | 93 { size, align, elts, elty, str } \ |
94 , | 94 , |
95 ICETYPE_TABLE | 95 ICETYPE_TABLE |
96 #undef X | 96 #undef X |
97 }; | 97 }; |
98 | 98 |
99 struct TypePropertyFields { | 99 struct TypePropertyFields { |
100 bool TypeIsVectorType; | 100 bool TypeIsVectorType; |
101 bool TypeIsIntegerType; | 101 bool TypeIsIntegerType; |
102 bool TypeIsScalarIntegerType; | 102 bool TypeIsScalarIntegerType; |
103 bool TypeIsVectorIntegerType; | 103 bool TypeIsVectorIntegerType; |
104 bool TypeIsIntegerArithmeticType; | 104 bool TypeIsIntegerArithmeticType; |
105 bool TypeIsFloatingType; | 105 bool TypeIsFloatingType; |
106 bool TypeIsScalarFloatingType; | 106 bool TypeIsScalarFloatingType; |
107 bool TypeIsVectorFloatingType; | 107 bool TypeIsVectorFloatingType; |
108 bool TypeIsLoadStoreType; | 108 bool TypeIsLoadStoreType; |
109 Type CompareResultType; | 109 Type CompareResultType; |
110 }; | 110 }; |
111 | 111 |
112 const TypePropertyFields TypePropertiesTable[] = { | 112 const TypePropertyFields TypePropertiesTable[] = { |
113 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ | 113 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ |
114 { \ | 114 { \ |
115 IsVec, IsInt, IsInt && !IsVec, IsInt && IsVec, IsIntArith, IsFloat, \ | 115 IsVec, IsInt, IsInt && !IsVec, IsInt && IsVec, IsIntArith, IsFloat, \ |
116 IsFloat && !IsVec, IsFloat && IsVec, IsLoadStore, CompareResult \ | 116 IsFloat && !IsVec, IsFloat && IsVec, IsLoadStore, CompareResult \ |
117 } \ | 117 } \ |
118 , | 118 , |
119 ICETYPE_PROPS_TABLE | 119 ICETYPE_PROPS_TABLE |
120 #undef X | 120 #undef X |
121 }; | 121 }; |
122 | 122 |
123 } // end anonymous namespace | 123 } // end anonymous namespace |
124 | 124 |
125 const char *targetArchString(const TargetArch Arch) { | 125 const char *targetArchString(const TargetArch Arch) { |
126 size_t Index = static_cast<size_t>(Arch); | 126 size_t Index = static_cast<size_t>(Arch); |
127 if (Index < TargetArch_NUM) | 127 if (Index < TargetArch_NUM) |
128 return TargetArchName[Index]; | 128 return TargetArchName[Index]; |
129 llvm_unreachable("Invalid target arch for targetArchString"); | 129 llvm_unreachable("Invalid target arch for targetArchString"); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 IsFirst = false; | 269 IsFirst = false; |
270 } else { | 270 } else { |
271 Stream << ", "; | 271 Stream << ", "; |
272 } | 272 } |
273 Stream << ArgTy; | 273 Stream << ArgTy; |
274 } | 274 } |
275 Stream << ")"; | 275 Stream << ")"; |
276 } | 276 } |
277 | 277 |
278 } // end of namespace Ice | 278 } // end of namespace Ice |
OLD | NEW |