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_COMPILER_MACHINE_TYPE_H_ |
6 #define V8_COMPILER_MACHINE_TYPE_H_ | 6 #define V8_COMPILER_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" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return -1; | 109 return -1; |
110 } | 110 } |
111 | 111 |
112 // Gets the element size in bytes of the machine type. | 112 // Gets the element size in bytes of the machine type. |
113 inline int ElementSizeOf(MachineType machine_type) { | 113 inline int ElementSizeOf(MachineType machine_type) { |
114 const int shift = ElementSizeLog2Of(machine_type); | 114 const int shift = ElementSizeLog2Of(machine_type); |
115 DCHECK_NE(-1, shift); | 115 DCHECK_NE(-1, shift); |
116 return 1 << shift; | 116 return 1 << shift; |
117 } | 117 } |
118 | 118 |
| 119 inline bool IsFloatingPoint(MachineType type) { |
| 120 MachineType rep = RepresentationOf(type); |
| 121 return rep == kRepFloat32 || rep == kRepFloat64; |
| 122 } |
| 123 |
119 typedef Signature<MachineType> MachineSignature; | 124 typedef Signature<MachineType> MachineSignature; |
120 | 125 |
121 } // namespace compiler | 126 } // namespace compiler |
122 } // namespace internal | 127 } // namespace internal |
123 } // namespace v8 | 128 } // namespace v8 |
124 | 129 |
125 #endif // V8_COMPILER_MACHINE_TYPE_H_ | 130 #endif // V8_COMPILER_MACHINE_TYPE_H_ |
OLD | NEW |