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/opcodes.h" | 6 #include "src/compiler/opcodes.h" |
7 #include "src/compiler/operator.h" | 7 #include "src/compiler/operator.h" |
8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
9 #include "test/unittests/test-utils.h" | 9 #include "test/unittests/test-utils.h" |
10 | 10 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 PURE(TruncateInt64ToInt32, 1, 0, 1), // -- | 240 PURE(TruncateInt64ToInt32, 1, 0, 1), // -- |
241 PURE(Float32Abs, 1, 0, 1), // -- | 241 PURE(Float32Abs, 1, 0, 1), // -- |
242 PURE(Float32Add, 2, 0, 1), // -- | 242 PURE(Float32Add, 2, 0, 1), // -- |
243 PURE(Float32Sub, 2, 0, 1), // -- | 243 PURE(Float32Sub, 2, 0, 1), // -- |
244 PURE(Float32Mul, 2, 0, 1), // -- | 244 PURE(Float32Mul, 2, 0, 1), // -- |
245 PURE(Float32Div, 2, 0, 1), // -- | 245 PURE(Float32Div, 2, 0, 1), // -- |
246 PURE(Float32Sqrt, 1, 0, 1), // -- | 246 PURE(Float32Sqrt, 1, 0, 1), // -- |
247 PURE(Float32Equal, 2, 0, 1), // -- | 247 PURE(Float32Equal, 2, 0, 1), // -- |
248 PURE(Float32LessThan, 2, 0, 1), // -- | 248 PURE(Float32LessThan, 2, 0, 1), // -- |
249 PURE(Float32LessThanOrEqual, 2, 0, 1), // -- | 249 PURE(Float32LessThanOrEqual, 2, 0, 1), // -- |
| 250 PURE(Float32Neg, 1, 0, 1), // -- |
250 PURE(Float64Abs, 1, 0, 1), // -- | 251 PURE(Float64Abs, 1, 0, 1), // -- |
251 PURE(Float64Add, 2, 0, 1), // -- | 252 PURE(Float64Add, 2, 0, 1), // -- |
252 PURE(Float64Sub, 2, 0, 1), // -- | 253 PURE(Float64Sub, 2, 0, 1), // -- |
253 PURE(Float64Mul, 2, 0, 1), // -- | 254 PURE(Float64Mul, 2, 0, 1), // -- |
254 PURE(Float64Div, 2, 0, 1), // -- | 255 PURE(Float64Div, 2, 0, 1), // -- |
255 PURE(Float64Mod, 2, 0, 1), // -- | 256 PURE(Float64Mod, 2, 0, 1), // -- |
256 PURE(Float64Sqrt, 1, 0, 1), // -- | 257 PURE(Float64Sqrt, 1, 0, 1), // -- |
257 PURE(Float64Max, 2, 0, 1), // -- | 258 PURE(Float64Max, 2, 0, 1), // -- |
258 PURE(Float64Min, 2, 0, 1), // -- | 259 PURE(Float64Min, 2, 0, 1), // -- |
259 PURE(Float64Equal, 2, 0, 1), // -- | 260 PURE(Float64Equal, 2, 0, 1), // -- |
260 PURE(Float64LessThan, 2, 0, 1), // -- | 261 PURE(Float64LessThan, 2, 0, 1), // -- |
261 PURE(Float64LessThanOrEqual, 2, 0, 1), // -- | 262 PURE(Float64LessThanOrEqual, 2, 0, 1), // -- |
262 PURE(LoadStackPointer, 0, 0, 1), // -- | 263 PURE(LoadStackPointer, 0, 0, 1), // -- |
263 PURE(Float64ExtractLowWord32, 1, 0, 1), // -- | 264 PURE(Float64ExtractLowWord32, 1, 0, 1), // -- |
264 PURE(Float64ExtractHighWord32, 1, 0, 1), // -- | 265 PURE(Float64ExtractHighWord32, 1, 0, 1), // -- |
265 PURE(Float64InsertLowWord32, 2, 0, 1), // -- | 266 PURE(Float64InsertLowWord32, 2, 0, 1), // -- |
266 PURE(Float64InsertHighWord32, 2, 0, 1), // -- | 267 PURE(Float64InsertHighWord32, 2, 0, 1), // -- |
| 268 PURE(Float64Neg, 1, 0, 1), // -- |
267 #undef PURE | 269 #undef PURE |
268 }; | 270 }; |
269 | 271 |
270 } // namespace | 272 } // namespace |
271 | 273 |
272 class MachinePureOperatorTest : public TestWithZone { | 274 class MachinePureOperatorTest : public TestWithZone { |
273 protected: | 275 protected: |
274 MachineRepresentation word_type() { | 276 MachineRepresentation word_type() { |
275 return MachineType::PointerRepresentation(); | 277 return MachineType::PointerRepresentation(); |
276 } | 278 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const OptionalOperatorEntry kOptionalOperators[] = { | 318 const OptionalOperatorEntry kOptionalOperators[] = { |
317 #define OPTIONAL_ENTRY(Name, value_input_count, control_input_count, \ | 319 #define OPTIONAL_ENTRY(Name, value_input_count, control_input_count, \ |
318 value_output_count) \ | 320 value_output_count) \ |
319 { \ | 321 { \ |
320 &MachineOperatorBuilder::Name, MachineOperatorBuilder::k##Name, #Name, \ | 322 &MachineOperatorBuilder::Name, MachineOperatorBuilder::k##Name, #Name, \ |
321 value_input_count, control_input_count, value_output_count \ | 323 value_input_count, control_input_count, value_output_count \ |
322 } | 324 } |
323 OPTIONAL_ENTRY(Float64RoundDown, 1, 0, 1), // -- | 325 OPTIONAL_ENTRY(Float64RoundDown, 1, 0, 1), // -- |
324 OPTIONAL_ENTRY(Float64RoundTruncate, 1, 0, 1), // -- | 326 OPTIONAL_ENTRY(Float64RoundTruncate, 1, 0, 1), // -- |
325 OPTIONAL_ENTRY(Float64RoundTiesAway, 1, 0, 1), // -- | 327 OPTIONAL_ENTRY(Float64RoundTiesAway, 1, 0, 1), // -- |
326 OPTIONAL_ENTRY(Float32Neg, 1, 0, 1), // -- | |
327 OPTIONAL_ENTRY(Float64Neg, 1, 0, 1), // -- | |
328 #undef OPTIONAL_ENTRY | 328 #undef OPTIONAL_ENTRY |
329 }; | 329 }; |
330 } // namespace | 330 } // namespace |
331 | 331 |
332 | 332 |
333 class MachineOptionalOperatorTest : public TestWithZone { | 333 class MachineOptionalOperatorTest : public TestWithZone { |
334 protected: | 334 protected: |
335 MachineRepresentation word_rep() { | 335 MachineRepresentation word_rep() { |
336 return MachineType::PointerRepresentation(); | 336 return MachineType::PointerRepresentation(); |
337 } | 337 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 EXPECT_EQ(machine.Uint64Div(), machine.UintDiv()); | 411 EXPECT_EQ(machine.Uint64Div(), machine.UintDiv()); |
412 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); | 412 EXPECT_EQ(machine.Int64Mod(), machine.IntMod()); |
413 EXPECT_EQ(machine.Uint64Mod(), machine.UintMod()); | 413 EXPECT_EQ(machine.Uint64Mod(), machine.UintMod()); |
414 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); | 414 EXPECT_EQ(machine.Int64LessThan(), machine.IntLessThan()); |
415 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); | 415 EXPECT_EQ(machine.Int64LessThanOrEqual(), machine.IntLessThanOrEqual()); |
416 } | 416 } |
417 | 417 |
418 } // namespace compiler | 418 } // namespace compiler |
419 } // namespace internal | 419 } // namespace internal |
420 } // namespace v8 | 420 } // namespace v8 |
OLD | NEW |