| 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 28 matching lines...) Expand all Loading... |
| 39 _props_table_tag_##tag, | 39 _props_table_tag_##tag, |
| 40 ICETYPE_PROPS_TABLE | 40 ICETYPE_PROPS_TABLE |
| 41 #undef X | 41 #undef X |
| 42 _enum_props_table_tag_Names | 42 _enum_props_table_tag_Names |
| 43 }; | 43 }; |
| 44 // Assert that tags in ICETYPE_TABLE are also in ICETYPE_PROPS_TABLE. | 44 // Assert that tags in ICETYPE_TABLE are also in ICETYPE_PROPS_TABLE. |
| 45 #define X(tag, size, align, elts, elty, str) \ | 45 #define X(tag, size, align, elts, elty, str) \ |
| 46 static_assert( \ | 46 static_assert( \ |
| 47 (unsigned)_table_tag_##tag == (unsigned)_props_table_tag_##tag, \ | 47 (unsigned)_table_tag_##tag == (unsigned)_props_table_tag_##tag, \ |
| 48 "Inconsistency between ICETYPE_PROPS_TABLE and ICETYPE_TABLE"); | 48 "Inconsistency between ICETYPE_PROPS_TABLE and ICETYPE_TABLE"); |
| 49 ICETYPE_TABLE; | 49 ICETYPE_TABLE |
| 50 #undef X | 50 #undef X |
| 51 // Assert that tags in ICETYPE_PROPS_TABLE is in ICETYPE_TABLE. | 51 // Assert that tags in ICETYPE_PROPS_TABLE is in ICETYPE_TABLE. |
| 52 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ | 52 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ |
| 53 static_assert( \ | 53 static_assert( \ |
| 54 (unsigned)_table_tag_##tag == (unsigned)_props_table_tag_##tag, \ | 54 (unsigned)_table_tag_##tag == (unsigned)_props_table_tag_##tag, \ |
| 55 "Inconsistency between ICETYPE_PROPS_TABLE and ICETYPE_TABLE"); | 55 "Inconsistency between ICETYPE_PROPS_TABLE and ICETYPE_TABLE"); |
| 56 ICETYPE_PROPS_TABLE | 56 ICETYPE_PROPS_TABLE |
| 57 #undef X | 57 #undef X |
| 58 | 58 |
| 59 // Show vector definitions match in ICETYPE_TABLE and | 59 // Show vector definitions match in ICETYPE_TABLE and |
| (...skipping 10 matching lines...) Expand all Loading... |
| 70 enum { | 70 enum { |
| 71 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ | 71 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ |
| 72 _props_table_IsVec_##tag = IsVec, | 72 _props_table_IsVec_##tag = IsVec, |
| 73 ICETYPE_PROPS_TABLE | 73 ICETYPE_PROPS_TABLE |
| 74 #undef X | 74 #undef X |
| 75 }; | 75 }; |
| 76 // Verify that the number of vector elements is consistent with IsVec. | 76 // Verify that the number of vector elements is consistent with IsVec. |
| 77 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ | 77 #define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult) \ |
| 78 static_assert((_table_elts_##tag > 1) == _props_table_IsVec_##tag, \ | 78 static_assert((_table_elts_##tag > 1) == _props_table_IsVec_##tag, \ |
| 79 "Inconsistent vector specification in ICETYPE_PROPS_TABLE"); | 79 "Inconsistent vector specification in ICETYPE_PROPS_TABLE"); |
| 80 ICETYPE_PROPS_TABLE; | 80 ICETYPE_PROPS_TABLE |
| 81 #undef X | 81 #undef X |
| 82 | 82 |
| 83 struct TypeAttributeFields { | 83 struct TypeAttributeFields { |
| 84 size_t TypeWidthInBytes; | 84 size_t TypeWidthInBytes; |
| 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 |
| (...skipping 178 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 |