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 #include "src/compiler/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
6 #include "src/compiler/operator-properties-inl.h" | 6 #include "src/compiler/operator-properties-inl.h" |
7 #include "testing/gtest-support.h" | 7 #include "testing/gtest-support.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 return os << IrOpcode::Mnemonic(pop.opcode); | 180 return os << IrOpcode::Mnemonic(pop.opcode); |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 const PureOperator kPureOperators[] = { | 184 const PureOperator kPureOperators[] = { |
185 #define PURE(Name, input_count, output_count) \ | 185 #define PURE(Name, input_count, output_count) \ |
186 { \ | 186 { \ |
187 &MachineOperatorBuilder::Name, IrOpcode::k##Name, input_count, \ | 187 &MachineOperatorBuilder::Name, IrOpcode::k##Name, input_count, \ |
188 output_count \ | 188 output_count \ |
189 } | 189 } |
190 PURE(Word32And, 2, 1), PURE(Word32Or, 2, 1), | 190 PURE(Word32And, 2, 1), PURE(Word32Or, 2, 1), |
191 PURE(Word32Xor, 2, 1), PURE(Word32Shl, 2, 1), | 191 PURE(Word32Xor, 2, 1), PURE(Word32Shl, 2, 1), |
192 PURE(Word32Shr, 2, 1), PURE(Word32Sar, 2, 1), | 192 PURE(Word32Shr, 2, 1), PURE(Word32Sar, 2, 1), |
193 PURE(Word32Ror, 2, 1), PURE(Word32Equal, 2, 1), | 193 PURE(Word32Ror, 2, 1), PURE(Word32Equal, 2, 1), |
194 PURE(Word64And, 2, 1), PURE(Word64Or, 2, 1), | 194 PURE(Word64And, 2, 1), PURE(Word64Or, 2, 1), |
195 PURE(Word64Xor, 2, 1), PURE(Word64Shl, 2, 1), | 195 PURE(Word64Xor, 2, 1), PURE(Word64Shl, 2, 1), |
196 PURE(Word64Shr, 2, 1), PURE(Word64Sar, 2, 1), | 196 PURE(Word64Shr, 2, 1), PURE(Word64Sar, 2, 1), |
197 PURE(Word64Ror, 2, 1), PURE(Word64Equal, 2, 1), | 197 PURE(Word64Ror, 2, 1), PURE(Word64Equal, 2, 1), |
198 PURE(Int32Add, 2, 1), PURE(Int32AddWithOverflow, 2, 2), | 198 PURE(Int32Add, 2, 1), PURE(Int32AddWithOverflow, 2, 2), |
199 PURE(Int32Sub, 2, 1), PURE(Int32SubWithOverflow, 2, 2), | 199 PURE(Int32Sub, 2, 1), PURE(Int32SubWithOverflow, 2, 2), |
200 PURE(Int32Mul, 2, 1), PURE(Int32Div, 2, 1), | 200 PURE(Int32Mul, 2, 1), PURE(Int32Div, 2, 1), |
201 PURE(Int32UDiv, 2, 1), PURE(Int32Mod, 2, 1), | 201 PURE(Int32UDiv, 2, 1), PURE(Int32Mod, 2, 1), |
202 PURE(Int32UMod, 2, 1), PURE(Int32LessThan, 2, 1), | 202 PURE(Int32UMod, 2, 1), PURE(Int32LessThan, 2, 1), |
203 PURE(Int32LessThanOrEqual, 2, 1), PURE(Uint32LessThan, 2, 1), | 203 PURE(Int32LessThanOrEqual, 2, 1), PURE(Uint32LessThan, 2, 1), |
204 PURE(Uint32LessThanOrEqual, 2, 1), PURE(Int64Add, 2, 1), | 204 PURE(Uint32LessThanOrEqual, 2, 1), PURE(Int64Add, 2, 1), |
205 PURE(Int64Sub, 2, 1), PURE(Int64Mul, 2, 1), | 205 PURE(Int64Sub, 2, 1), PURE(Int64Mul, 2, 1), |
206 PURE(Int64Div, 2, 1), PURE(Int64UDiv, 2, 1), | 206 PURE(Int64Div, 2, 1), PURE(Int64UDiv, 2, 1), |
207 PURE(Int64Mod, 2, 1), PURE(Int64UMod, 2, 1), | 207 PURE(Int64Mod, 2, 1), PURE(Int64UMod, 2, 1), |
208 PURE(Int64LessThan, 2, 1), PURE(Int64LessThanOrEqual, 2, 1), | 208 PURE(Int64LessThan, 2, 1), PURE(Int64LessThanOrEqual, 2, 1), |
209 PURE(ChangeFloat64ToInt32, 1, 1), PURE(ChangeFloat64ToUint32, 1, 1), | 209 PURE(ChangeFloat32ToFloat64, 1, 1), PURE(ChangeFloat64ToInt32, 1, 1), |
210 PURE(ChangeInt32ToInt64, 1, 1), PURE(ChangeUint32ToFloat64, 1, 1), | 210 PURE(ChangeFloat64ToUint32, 1, 1), PURE(ChangeInt32ToInt64, 1, 1), |
211 PURE(ChangeUint32ToUint64, 1, 1), PURE(TruncateFloat64ToInt32, 1, 1), | 211 PURE(ChangeUint32ToFloat64, 1, 1), PURE(ChangeUint32ToUint64, 1, 1), |
212 PURE(TruncateInt64ToInt32, 1, 1), PURE(Float64Add, 2, 1), | 212 PURE(TruncateFloat64ToFloat32, 1, 1), PURE(TruncateFloat64ToInt32, 1, 1), |
213 PURE(Float64Sub, 2, 1), PURE(Float64Mul, 2, 1), | 213 PURE(TruncateInt64ToInt32, 1, 1), PURE(Float64Add, 2, 1), |
214 PURE(Float64Div, 2, 1), PURE(Float64Mod, 2, 1), | 214 PURE(Float64Sub, 2, 1), PURE(Float64Mul, 2, 1), |
215 PURE(Float64Equal, 2, 1), PURE(Float64LessThan, 2, 1), | 215 PURE(Float64Div, 2, 1), PURE(Float64Mod, 2, 1), |
| 216 PURE(Float64Equal, 2, 1), PURE(Float64LessThan, 2, 1), |
216 PURE(Float64LessThanOrEqual, 2, 1) | 217 PURE(Float64LessThanOrEqual, 2, 1) |
217 #undef PURE | 218 #undef PURE |
218 }; | 219 }; |
219 | 220 |
220 | 221 |
221 typedef MachineOperatorTestWithParam<PureOperator> MachinePureOperatorTest; | 222 typedef MachineOperatorTestWithParam<PureOperator> MachinePureOperatorTest; |
222 | 223 |
223 } // namespace | 224 } // namespace |
224 | 225 |
225 | 226 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 EXPECT_EQ(machine.Int64UDiv(), machine.IntUDiv()); | 316 EXPECT_EQ(machine.Int64UDiv(), machine.IntUDiv()); |
316 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); | 317 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); |
317 EXPECT_EQ(machine.Int64UMod(), machine.IntUMod()); | 318 EXPECT_EQ(machine.Int64UMod(), machine.IntUMod()); |
318 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); | 319 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); |
319 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); | 320 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); |
320 } | 321 } |
321 | 322 |
322 } // namespace compiler | 323 } // namespace compiler |
323 } // namespace internal | 324 } // namespace internal |
324 } // namespace v8 | 325 } // namespace v8 |
OLD | NEW |