| 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_MACHINE_TYPE_H_ | 5 #ifndef V8_MACHINE_TYPE_H_ |
| 6 #define V8_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" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 return static_cast<size_t>(type.representation()) + | 170 return static_cast<size_t>(type.representation()) + |
| 171 static_cast<size_t>(type.semantic()) * 16; | 171 static_cast<size_t>(type.semantic()) * 16; |
| 172 } | 172 } |
| 173 | 173 |
| 174 std::ostream& operator<<(std::ostream& os, MachineRepresentation rep); | 174 std::ostream& operator<<(std::ostream& os, MachineRepresentation rep); |
| 175 std::ostream& operator<<(std::ostream& os, MachineSemantic type); | 175 std::ostream& operator<<(std::ostream& os, MachineSemantic type); |
| 176 std::ostream& operator<<(std::ostream& os, MachineType type); | 176 std::ostream& operator<<(std::ostream& os, MachineType type); |
| 177 | 177 |
| 178 inline bool IsFloatingPoint(MachineRepresentation rep) { | 178 inline bool IsFloatingPoint(MachineRepresentation rep) { |
| 179 return rep == MachineRepresentation::kFloat32 || | 179 return rep == MachineRepresentation::kFloat32 || |
| 180 rep == MachineRepresentation::kFloat64; | 180 rep == MachineRepresentation::kFloat64 || |
| 181 rep == MachineRepresentation::kSimd128; |
| 181 } | 182 } |
| 182 | 183 |
| 183 // Gets the log2 of the element size in bytes of the machine type. | 184 // Gets the log2 of the element size in bytes of the machine type. |
| 184 inline int ElementSizeLog2Of(MachineRepresentation rep) { | 185 inline int ElementSizeLog2Of(MachineRepresentation rep) { |
| 185 switch (rep) { | 186 switch (rep) { |
| 186 case MachineRepresentation::kBit: | 187 case MachineRepresentation::kBit: |
| 187 case MachineRepresentation::kWord8: | 188 case MachineRepresentation::kWord8: |
| 188 return 0; | 189 return 0; |
| 189 case MachineRepresentation::kWord16: | 190 case MachineRepresentation::kWord16: |
| 190 return 1; | 191 return 1; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 204 UNREACHABLE(); | 205 UNREACHABLE(); |
| 205 return -1; | 206 return -1; |
| 206 } | 207 } |
| 207 | 208 |
| 208 typedef Signature<MachineType> MachineSignature; | 209 typedef Signature<MachineType> MachineSignature; |
| 209 | 210 |
| 210 } // namespace internal | 211 } // namespace internal |
| 211 } // namespace v8 | 212 } // namespace v8 |
| 212 | 213 |
| 213 #endif // V8_MACHINE_TYPE_H_ | 214 #endif // V8_MACHINE_TYPE_H_ |
| OLD | NEW |