Home | History | Annotate | Download | only in optimizing

Lines Matching refs:Type

30   enum class Type : uint8_t {
47 static constexpr Type FromShorty(char type);
48 static constexpr char TypeId(DataType::Type type);
50 static constexpr size_t SizeShift(Type type) {
51 switch (type) {
52 case Type::kVoid:
53 case Type::kBool:
54 case Type::kUint8:
55 case Type::kInt8:
57 case Type::kUint16:
58 case Type::kInt16:
60 case Type::kUint32:
61 case Type::kInt32:
62 case Type::kFloat32:
64 case Type::kUint64:
65 case Type::kInt64:
66 case Type::kFloat64:
68 case Type::kReference:
71 LOG(FATAL) << "Invalid type " << static_cast<int>(type);
76 static constexpr size_t Size(Type type) {
77 switch (type) {
78 case Type::kVoid:
80 case Type::kBool:
81 case Type::kUint8:
82 case Type::kInt8:
84 case Type::kUint16:
85 case Type::kInt16:
87 case Type::kUint32:
88 case Type::kInt32:
89 case Type::kFloat32:
91 case Type::kUint64:
92 case Type::kInt64:
93 case Type::kFloat64:
95 case Type::kReference:
98 LOG(FATAL) << "Invalid type " << static_cast<int>(type);
103 static bool IsFloatingPointType(Type type) {
104 return type == Type::kFloat32 || type == Type::kFloat64;
107 static bool IsIntegralType(Type type) {
108 // The Java language does not allow treating boolean as an integral type but
110 switch (type) {
111 case Type::kBool:
112 case Type::kUint8:
113 case Type::kInt8:
114 case Type::kUint16:
115 case Type::kInt16:
116 case Type::kUint32:
117 case Type::kInt32:
118 case Type::kUint64:
119 case Type::kInt64:
126 static bool IsIntOrLongType(Type type) {
127 return type == Type::kInt32 || type == Type::kInt64;
130 static bool Is64BitType(Type type) {
131 return type == Type::kUint64 || type == Type::kInt64 || type == Type::kFloat64;
134 static bool IsUnsignedType(Type type) {
135 return type == Type::kBool || type == Type::kUint8 || type == Type::kUint16 ||
136 type == Type::kUint32 || type == Type::kUint64;
139 // Return the general kind of `type`, fusing integer-like types as Type::kInt.
140 static Type Kind(Type type) {
141 switch (type) {
142 case Type::kBool:
143 case Type::kUint8:
144 case Type::kInt8:
145 case Type::kUint16:
146 case Type::kInt16:
147 case Type::kUint32:
148 case Type::kInt32:
149 return Type::kInt32;
150 case Type::kUint64:
151 case Type::kInt64:
152 return Type::kInt64;
154 return type;
158 static int64_t MinValueOfIntegralType(Type type) {
159 switch (type) {
160 case Type::kBool:
162 case Type::kUint8:
164 case Type::kInt8:
166 case Type::kUint16:
168 case Type::kInt16:
170 case Type::kUint32:
172 case Type::kInt32:
174 case Type::kUint64:
176 case Type::kInt64:
179 LOG(FATAL) << "non integral type";
184 static int64_t MaxValueOfIntegralType(Type type) {
185 switch (type) {
186 case Type::kBool:
188 case Type::kUint8:
190 case Type::kInt8:
192 case Type::kUint16:
194 case Type::kInt16:
196 case Type::kUint32:
198 case Type::kInt32:
200 case Type::kUint64:
202 case Type::kInt64:
205 LOG(FATAL) << "non integral type";
210 static bool IsTypeConversionImplicit(Type input_type, Type result_type);
211 static bool IsTypeConversionImplicit(int64_t value, Type result_type);
213 static const char* PrettyDescriptor(Type type);
218 std::ostream& operator<<(std::ostream& os, DataType::Type data_type);
221 inline bool DataType::IsTypeConversionImplicit(Type input_type, Type result_type) {
222 DCHECK_NE(DataType::Type::kVoid, result_type);
223 DCHECK_NE(DataType::Type::kVoid, input_type);
226 DCHECK_NE(DataType::Type::kBool, result_type);
228 // Besides conversion to the same type, integral conversions to non-Int64 types
232 (result_type != Type::kInt64 &&
239 inline bool DataType::IsTypeConversionImplicit(int64_t value, Type result_type) {
240 if (IsIntegralType(result_type) && result_type != Type::kInt64) {
241 // If the constant value falls in the range of the result_type, type