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 /// \file | 10 /// \file |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 struct TypeAttributeFields { | 88 struct TypeAttributeFields { |
89 int8_t TypeWidthInBytesLog2; | 89 int8_t TypeWidthInBytesLog2; |
90 size_t TypeAlignInBytes; | 90 size_t TypeAlignInBytes; |
91 size_t TypeNumElements; | 91 size_t TypeNumElements; |
92 Type TypeElementType; | 92 Type TypeElementType; |
93 const char *DisplayString; | 93 const char *DisplayString; |
94 }; | 94 }; |
95 | 95 |
96 const struct TypeAttributeFields TypeAttributes[] = { | 96 const struct TypeAttributeFields TypeAttributes[] = { |
97 #define X(tag, sizeLog2, align, elts, elty, str) \ | 97 #define X(tag, sizeLog2, align, elts, elty, str) \ |
98 { sizeLog2, align, elts, elty, str } \ | 98 { sizeLog2, align, elts, IceType_##elty, str } \ |
99 , | 99 , |
100 ICETYPE_TABLE | 100 ICETYPE_TABLE |
101 #undef X | 101 #undef X |
102 }; | 102 }; |
103 | 103 |
104 struct TypePropertyFields { | 104 struct TypePropertyFields { |
105 bool TypeIsVectorType; | 105 bool TypeIsVectorType; |
106 bool TypeIsIntegerType; | 106 bool TypeIsIntegerType; |
107 bool TypeIsScalarIntegerType; | 107 bool TypeIsScalarIntegerType; |
108 bool TypeIsVectorIntegerType; | 108 bool TypeIsVectorIntegerType; |
109 bool TypeIsIntegerArithmeticType; | 109 bool TypeIsIntegerArithmeticType; |
110 bool TypeIsFloatingType; | 110 bool TypeIsFloatingType; |
111 bool TypeIsScalarFloatingType; | 111 bool TypeIsScalarFloatingType; |
112 bool TypeIsVectorFloatingType; | 112 bool TypeIsVectorFloatingType; |
113 bool TypeIsLoadStoreType; | 113 bool TypeIsLoadStoreType; |
114 bool TypeIsCallParameterType; | 114 bool TypeIsCallParameterType; |
115 Type CompareResultType; | 115 Type CompareResultType; |
116 }; | 116 }; |
117 | 117 |
118 const TypePropertyFields TypePropertiesTable[] = { | 118 const TypePropertyFields TypePropertiesTable[] = { |
119 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, IsParam, \ | 119 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, IsParam, \ |
120 CompareResult) \ | 120 CompareResult) \ |
121 { \ | 121 { \ |
122 IsVec, IsInt, IsInt & !IsVec, IsInt & IsVec, IsIntArith, IsFloat, \ | 122 IsVec, IsInt, IsInt & !IsVec, IsInt & IsVec, IsIntArith, IsFloat, \ |
123 IsFloat & !IsVec, IsFloat & IsVec, IsLoadStore, IsParam, CompareResult \ | 123 IsFloat & !IsVec, IsFloat & IsVec, IsLoadStore, IsParam, \ |
| 124 IceType_##CompareResult \ |
124 } \ | 125 } \ |
125 , | 126 , |
126 ICETYPE_PROPS_TABLE | 127 ICETYPE_PROPS_TABLE |
127 #undef X | 128 #undef X |
128 }; | 129 }; |
129 | 130 |
130 } // end anonymous namespace | 131 } // end anonymous namespace |
131 | 132 |
132 const char *targetArchString(const TargetArch Arch) { | 133 const char *targetArchString(const TargetArch Arch) { |
133 size_t Index = static_cast<size_t>(Arch); | 134 size_t Index = static_cast<size_t>(Arch); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 IsFirst = false; | 290 IsFirst = false; |
290 } else { | 291 } else { |
291 Stream << ", "; | 292 Stream << ", "; |
292 } | 293 } |
293 Stream << ArgTy; | 294 Stream << ArgTy; |
294 } | 295 } |
295 Stream << ")"; | 296 Stream << ")"; |
296 } | 297 } |
297 | 298 |
298 } // end of namespace Ice | 299 } // end of namespace Ice |
OLD | NEW |