OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_OPERATOR_H_ | 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ |
6 #define V8_COMPILER_MACHINE_OPERATOR_H_ | 6 #define V8_COMPILER_MACHINE_OPERATOR_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/machine-type.h" | 9 #include "src/machine-type.h" |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 kUint32DivIsSafe = 1u << 14, | 114 kUint32DivIsSafe = 1u << 14, |
115 kWord32ShiftIsSafe = 1u << 15, | 115 kWord32ShiftIsSafe = 1u << 15, |
116 kWord32Ctz = 1u << 16, | 116 kWord32Ctz = 1u << 16, |
117 kWord64Ctz = 1u << 17, | 117 kWord64Ctz = 1u << 17, |
118 kWord32Popcnt = 1u << 18, | 118 kWord32Popcnt = 1u << 18, |
119 kWord64Popcnt = 1u << 19, | 119 kWord64Popcnt = 1u << 19, |
120 kWord32ReverseBits = 1u << 20, | 120 kWord32ReverseBits = 1u << 20, |
121 kWord64ReverseBits = 1u << 21, | 121 kWord64ReverseBits = 1u << 21, |
122 kFloat32Neg = 1u << 22, | 122 kFloat32Neg = 1u << 22, |
123 kFloat64Neg = 1u << 23, | 123 kFloat64Neg = 1u << 23, |
124 kAllOptionalOps = | 124 kWord32ReverseBytes = 1u << 24, |
125 kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | | 125 kWord64ReverseBytes = 1u << 25, |
126 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | | 126 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | |
127 kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate | | 127 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | |
128 kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven | | 128 kFloat64RoundUp | kFloat32RoundTruncate | |
129 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | | 129 kFloat64RoundTruncate | kFloat64RoundTiesAway | |
130 kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg | kFloat64Neg | 130 kFloat32RoundTiesEven | kFloat64RoundTiesEven | |
| 131 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | |
| 132 kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg | |
| 133 kFloat64Neg | kWord32ReverseBytes | kWord64ReverseBytes |
131 }; | 134 }; |
132 typedef base::Flags<Flag, unsigned> Flags; | 135 typedef base::Flags<Flag, unsigned> Flags; |
133 | 136 |
134 class AlignmentRequirements { | 137 class AlignmentRequirements { |
135 public: | 138 public: |
136 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport }; | 139 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport }; |
137 | 140 |
138 bool IsUnalignedLoadSupported(const MachineType& machineType, | 141 bool IsUnalignedLoadSupported(const MachineType& machineType, |
139 uint8_t alignment) const { | 142 uint8_t alignment) const { |
140 return IsUnalignedSupported(unalignedLoadSupportedTypes_, machineType, | 143 return IsUnalignedSupported(unalignedLoadSupportedTypes_, machineType, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 const Operator* Word32Shr(); | 213 const Operator* Word32Shr(); |
211 const Operator* Word32Sar(); | 214 const Operator* Word32Sar(); |
212 const Operator* Word32Ror(); | 215 const Operator* Word32Ror(); |
213 const Operator* Word32Equal(); | 216 const Operator* Word32Equal(); |
214 const Operator* Word32Clz(); | 217 const Operator* Word32Clz(); |
215 const OptionalOperator Word32Ctz(); | 218 const OptionalOperator Word32Ctz(); |
216 const OptionalOperator Word32Popcnt(); | 219 const OptionalOperator Word32Popcnt(); |
217 const OptionalOperator Word64Popcnt(); | 220 const OptionalOperator Word64Popcnt(); |
218 const OptionalOperator Word32ReverseBits(); | 221 const OptionalOperator Word32ReverseBits(); |
219 const OptionalOperator Word64ReverseBits(); | 222 const OptionalOperator Word64ReverseBits(); |
| 223 const OptionalOperator Word32ReverseBytes(); |
| 224 const OptionalOperator Word64ReverseBytes(); |
220 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } | 225 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } |
221 | 226 |
222 const Operator* Word64And(); | 227 const Operator* Word64And(); |
223 const Operator* Word64Or(); | 228 const Operator* Word64Or(); |
224 const Operator* Word64Xor(); | 229 const Operator* Word64Xor(); |
225 const Operator* Word64Shl(); | 230 const Operator* Word64Shl(); |
226 const Operator* Word64Shr(); | 231 const Operator* Word64Shr(); |
227 const Operator* Word64Sar(); | 232 const Operator* Word64Sar(); |
228 const Operator* Word64Ror(); | 233 const Operator* Word64Ror(); |
229 const Operator* Word64Clz(); | 234 const Operator* Word64Clz(); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 }; | 682 }; |
678 | 683 |
679 | 684 |
680 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 685 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
681 | 686 |
682 } // namespace compiler | 687 } // namespace compiler |
683 } // namespace internal | 688 } // namespace internal |
684 } // namespace v8 | 689 } // namespace v8 |
685 | 690 |
686 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 691 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |