Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- C++ -*-===// | 1 //===- subzero/src/IceTypes.h - Primitive ICE types -------------*- C++ -*-===// |
| 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 declares a few properties of the primitive types allowed | 10 // This file declares a few properties of the primitive types allowed |
| 11 // in Subzero. Every Subzero source file is expected to include | 11 // in Subzero. Every Subzero source file is expected to include |
| 12 // IceTypes.h. | 12 // IceTypes.h. |
| 13 // | 13 // |
| 14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
| 15 | 15 |
| 16 #ifndef SUBZERO_SRC_ICETYPES_H | 16 #ifndef SUBZERO_SRC_ICETYPES_H |
| 17 #define SUBZERO_SRC_ICETYPES_H | 17 #define SUBZERO_SRC_ICETYPES_H |
| 18 | 18 |
| 19 #include "IceTypes.def" | 19 #include "IceTypes.def" |
| 20 | 20 |
| 21 namespace Ice { | 21 namespace Ice { |
| 22 | 22 |
| 23 enum TypeFlag { | |
| 24 TypeFlagIsInteger = 0x1, | |
|
Jim Stichnoth
2014/07/24 19:55:22
Why these specific choices of enum value?
If thes
Karl
2014/07/25 21:49:03
After talking to Jim, refactoring IceTypes.defs to
| |
| 25 TypeFlagIsFloating = 0x2 | |
| 26 }; | |
| 27 | |
| 23 enum Type { | 28 enum Type { |
| 24 #define X(tag, size, align, elts, elty, str) tag, | 29 #define X(tag, size, align, elts, elty, str, flags) tag, |
| 25 ICETYPE_TABLE | 30 ICETYPE_TABLE |
| 26 #undef X | 31 #undef X |
| 27 IceType_NUM | 32 IceType_NUM |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 enum TargetArch { | 35 enum TargetArch { |
| 31 Target_X8632, | 36 Target_X8632, |
| 32 Target_X8664, | 37 Target_X8664, |
| 33 Target_ARM32, | 38 Target_ARM32, |
| 34 Target_ARM64 | 39 Target_ARM64 |
| 35 }; | 40 }; |
| 36 | 41 |
| 37 enum OptLevel { | 42 enum OptLevel { |
| 38 Opt_m1, | 43 Opt_m1, |
| 39 Opt_0, | 44 Opt_0, |
| 40 Opt_1, | 45 Opt_1, |
| 41 Opt_2 | 46 Opt_2 |
| 42 }; | 47 }; |
| 43 | 48 |
| 44 size_t typeWidthInBytes(Type Ty); | 49 size_t typeWidthInBytes(Type Ty); |
| 45 size_t typeAlignInBytes(Type Ty); | 50 size_t typeAlignInBytes(Type Ty); |
| 46 size_t typeNumElements(Type Ty); | 51 size_t typeNumElements(Type Ty); |
| 47 Type typeElementType(Type Ty); | 52 Type typeElementType(Type Ty); |
| 48 | 53 |
| 54 bool isIntegerType(Type Ty); | |
| 55 bool isFloatingType(Type Ty); | |
| 49 inline bool isVectorType(Type Ty) { return typeNumElements(Ty) > 1; } | 56 inline bool isVectorType(Type Ty) { return typeNumElements(Ty) > 1; } |
| 50 | 57 |
| 51 template <> Ostream &operator<<(class Ostream &Str, const Type &Ty); | 58 Ostream &operator<<(class Ostream &Str, const Type &Ty); |
| 52 | 59 |
| 53 } // end of namespace Ice | 60 } // end of namespace Ice |
| 54 | 61 |
| 55 #endif // SUBZERO_SRC_ICETYPES_H | 62 #endif // SUBZERO_SRC_ICETYPES_H |
| OLD | NEW |