OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 | 10 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 Matcher<Node*> shl_matcher = IsWord32PairShl( | 344 Matcher<Node*> shl_matcher = IsWord32PairShl( |
345 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), | 345 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), |
346 IsInt32Constant(low_word_value(1))); | 346 IsInt32Constant(low_word_value(1))); |
347 | 347 |
348 EXPECT_THAT(graph()->end()->InputAt(1), | 348 EXPECT_THAT(graph()->end()->InputAt(1), |
349 IsReturn2(IsProjection(0, AllOf(CaptureEq(&shl), shl_matcher)), | 349 IsReturn2(IsProjection(0, AllOf(CaptureEq(&shl), shl_matcher)), |
350 IsProjection(1, AllOf(CaptureEq(&shl), shl_matcher)), | 350 IsProjection(1, AllOf(CaptureEq(&shl), shl_matcher)), |
351 start(), start())); | 351 start(), start())); |
352 } | 352 } |
353 // kExprI64ShrU: | 353 // kExprI64ShrU: |
| 354 TEST_F(Int64LoweringTest, Int64ShrU) { |
| 355 LowerGraph(graph()->NewNode(machine()->Word64Shr(), Int64Constant(value(0)), |
| 356 Int64Constant(value(1))), |
| 357 MachineRepresentation::kWord64); |
| 358 |
| 359 Capture<Node*> shr; |
| 360 Matcher<Node*> shr_matcher = IsWord32PairShr( |
| 361 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), |
| 362 IsInt32Constant(low_word_value(1))); |
| 363 |
| 364 EXPECT_THAT(graph()->end()->InputAt(1), |
| 365 IsReturn2(IsProjection(0, AllOf(CaptureEq(&shr), shr_matcher)), |
| 366 IsProjection(1, AllOf(CaptureEq(&shr), shr_matcher)), |
| 367 start(), start())); |
| 368 } |
354 // kExprI64ShrS: | 369 // kExprI64ShrS: |
| 370 TEST_F(Int64LoweringTest, Int64ShrS) { |
| 371 LowerGraph(graph()->NewNode(machine()->Word64Sar(), Int64Constant(value(0)), |
| 372 Int64Constant(value(1))), |
| 373 MachineRepresentation::kWord64); |
| 374 |
| 375 Capture<Node*> sar; |
| 376 Matcher<Node*> sar_matcher = IsWord32PairSar( |
| 377 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), |
| 378 IsInt32Constant(low_word_value(1))); |
| 379 |
| 380 EXPECT_THAT(graph()->end()->InputAt(1), |
| 381 IsReturn2(IsProjection(0, AllOf(CaptureEq(&sar), sar_matcher)), |
| 382 IsProjection(1, AllOf(CaptureEq(&sar), sar_matcher)), |
| 383 start(), start())); |
| 384 } |
355 // kExprI64Eq: | 385 // kExprI64Eq: |
356 TEST_F(Int64LoweringTest, Int64Eq) { | 386 TEST_F(Int64LoweringTest, Int64Eq) { |
357 LowerGraph(graph()->NewNode(machine()->Word64Equal(), Int64Constant(value(0)), | 387 LowerGraph(graph()->NewNode(machine()->Word64Equal(), Int64Constant(value(0)), |
358 Int64Constant(value(1))), | 388 Int64Constant(value(1))), |
359 MachineRepresentation::kWord32); | 389 MachineRepresentation::kWord32); |
360 EXPECT_THAT( | 390 EXPECT_THAT( |
361 graph()->end()->InputAt(1), | 391 graph()->end()->InputAt(1), |
362 IsReturn(IsWord32Equal( | 392 IsReturn(IsWord32Equal( |
363 IsWord32Or(IsWord32Xor(IsInt32Constant(low_word_value(0)), | 393 IsWord32Or(IsWord32Xor(IsInt32Constant(low_word_value(0)), |
364 IsInt32Constant(low_word_value(1))), | 394 IsInt32Constant(low_word_value(1))), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 // kExprF64SConvertI64: | 435 // kExprF64SConvertI64: |
406 // kExprF64UConvertI64: | 436 // kExprF64UConvertI64: |
407 // kExprI64SConvertF32: | 437 // kExprI64SConvertF32: |
408 // kExprI64SConvertF64: | 438 // kExprI64SConvertF64: |
409 // kExprI64UConvertF32: | 439 // kExprI64UConvertF32: |
410 // kExprI64UConvertF64: | 440 // kExprI64UConvertF64: |
411 | 441 |
412 } // namespace compiler | 442 } // namespace compiler |
413 } // namespace internal | 443 } // namespace internal |
414 } // namespace v8 | 444 } // namespace v8 |
OLD | NEW |