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/compiler/machine-type.h" | 9 #include "src/compiler/machine-type.h" |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 kFloat64Max = 1u << 2, | 112 kFloat64Max = 1u << 2, |
113 kFloat64Min = 1u << 3, | 113 kFloat64Min = 1u << 3, |
114 kFloat64RoundDown = 1u << 4, | 114 kFloat64RoundDown = 1u << 4, |
115 kFloat64RoundTruncate = 1u << 5, | 115 kFloat64RoundTruncate = 1u << 5, |
116 kFloat64RoundTiesAway = 1u << 6, | 116 kFloat64RoundTiesAway = 1u << 6, |
117 kInt32DivIsSafe = 1u << 7, | 117 kInt32DivIsSafe = 1u << 7, |
118 kUint32DivIsSafe = 1u << 8, | 118 kUint32DivIsSafe = 1u << 8, |
119 kWord32ShiftIsSafe = 1u << 9, | 119 kWord32ShiftIsSafe = 1u << 9, |
120 kWord32Ctz = 1u << 10, | 120 kWord32Ctz = 1u << 10, |
121 kWord32Popcnt = 1u << 11, | 121 kWord32Popcnt = 1u << 11, |
| 122 kWord64Ctz = 1u << 12, |
122 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | | 123 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | |
123 kFloat64RoundDown | kFloat64RoundTruncate | | 124 kFloat64RoundDown | kFloat64RoundTruncate | |
124 kFloat64RoundTiesAway | kWord32Ctz | kWord32Popcnt | 125 kFloat64RoundTiesAway | kWord32Ctz | kWord32Popcnt | |
| 126 kWord64Ctz |
125 }; | 127 }; |
126 typedef base::Flags<Flag, unsigned> Flags; | 128 typedef base::Flags<Flag, unsigned> Flags; |
127 | 129 |
128 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, | 130 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, |
129 Flags supportedOperators = kNoFlags); | 131 Flags supportedOperators = kNoFlags); |
130 | 132 |
131 const Operator* Word32And(); | 133 const Operator* Word32And(); |
132 const Operator* Word32Or(); | 134 const Operator* Word32Or(); |
133 const Operator* Word32Xor(); | 135 const Operator* Word32Xor(); |
134 const Operator* Word32Shl(); | 136 const Operator* Word32Shl(); |
135 const Operator* Word32Shr(); | 137 const Operator* Word32Shr(); |
136 const Operator* Word32Sar(); | 138 const Operator* Word32Sar(); |
137 const Operator* Word32Ror(); | 139 const Operator* Word32Ror(); |
138 const Operator* Word32Equal(); | 140 const Operator* Word32Equal(); |
139 const Operator* Word32Clz(); | 141 const Operator* Word32Clz(); |
140 const OptionalOperator Word32Ctz(); | 142 const OptionalOperator Word32Ctz(); |
141 const OptionalOperator Word32Popcnt(); | 143 const OptionalOperator Word32Popcnt(); |
142 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } | 144 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } |
143 | 145 |
144 const Operator* Word64And(); | 146 const Operator* Word64And(); |
145 const Operator* Word64Or(); | 147 const Operator* Word64Or(); |
146 const Operator* Word64Xor(); | 148 const Operator* Word64Xor(); |
147 const Operator* Word64Shl(); | 149 const Operator* Word64Shl(); |
148 const Operator* Word64Shr(); | 150 const Operator* Word64Shr(); |
149 const Operator* Word64Sar(); | 151 const Operator* Word64Sar(); |
150 const Operator* Word64Ror(); | 152 const Operator* Word64Ror(); |
151 const Operator* Word64Clz(); | 153 const Operator* Word64Clz(); |
| 154 const OptionalOperator Word64Ctz(); |
152 const Operator* Word64Equal(); | 155 const Operator* Word64Equal(); |
153 | 156 |
154 const Operator* Int32Add(); | 157 const Operator* Int32Add(); |
155 const Operator* Int32AddWithOverflow(); | 158 const Operator* Int32AddWithOverflow(); |
156 const Operator* Int32Sub(); | 159 const Operator* Int32Sub(); |
157 const Operator* Int32SubWithOverflow(); | 160 const Operator* Int32SubWithOverflow(); |
158 const Operator* Int32Mul(); | 161 const Operator* Int32Mul(); |
159 const Operator* Int32MulHigh(); | 162 const Operator* Int32MulHigh(); |
160 const Operator* Int32Div(); | 163 const Operator* Int32Div(); |
161 const Operator* Int32Mod(); | 164 const Operator* Int32Mod(); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 }; | 321 }; |
319 | 322 |
320 | 323 |
321 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 324 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
322 | 325 |
323 } // namespace compiler | 326 } // namespace compiler |
324 } // namespace internal | 327 } // namespace internal |
325 } // namespace v8 | 328 } // namespace v8 |
326 | 329 |
327 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 330 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |