OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_MACHINE_TYPE_H_ | 5 #ifndef V8_MACHINE_TYPE_H_ |
6 #define V8_COMPILER_MACHINE_TYPE_H_ | 6 #define V8_MACHINE_TYPE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
11 #include "src/globals.h" | 11 #include "src/globals.h" |
12 #include "src/signature.h" | 12 #include "src/signature.h" |
13 #include "src/zone.h" | 13 #include "src/zone.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 namespace compiler { | |
18 | 17 |
19 // Machine-level types and representations. | 18 // Machine-level types and representations. |
20 // TODO(titzer): Use the real type system instead of MachineType. | 19 // TODO(titzer): Use the real type system instead of MachineType. |
21 enum MachineType : uint16_t { | 20 enum MachineType : uint16_t { |
22 // Representations. | 21 // Representations. |
23 kRepBit = 1u << 0, | 22 kRepBit = 1u << 0, |
24 kRepWord8 = 1u << 1, | 23 kRepWord8 = 1u << 1, |
25 kRepWord16 = 1u << 2, | 24 kRepWord16 = 1u << 2, |
26 kRepWord32 = 1u << 3, | 25 kRepWord32 = 1u << 3, |
27 kRepWord64 = 1u << 4, | 26 kRepWord64 = 1u << 4, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return 1 << shift; | 115 return 1 << shift; |
117 } | 116 } |
118 | 117 |
119 inline bool IsFloatingPoint(MachineType type) { | 118 inline bool IsFloatingPoint(MachineType type) { |
120 MachineType rep = RepresentationOf(type); | 119 MachineType rep = RepresentationOf(type); |
121 return rep == kRepFloat32 || rep == kRepFloat64; | 120 return rep == kRepFloat32 || rep == kRepFloat64; |
122 } | 121 } |
123 | 122 |
124 typedef Signature<MachineType> MachineSignature; | 123 typedef Signature<MachineType> MachineSignature; |
125 | 124 |
126 } // namespace compiler | |
127 } // namespace internal | 125 } // namespace internal |
128 } // namespace v8 | 126 } // namespace v8 |
129 | 127 |
130 #endif // V8_COMPILER_MACHINE_TYPE_H_ | 128 #endif // V8_MACHINE_TYPE_H_ |
OLD | NEW |