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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/machine-operator.h" | 7 #include "src/compiler/machine-operator.h" |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 EXPECT_TRUE(matcher->matches()); | 36 EXPECT_TRUE(matcher->matches()); |
37 EXPECT_EQ(index, matcher->index()); | 37 EXPECT_EQ(index, matcher->index()); |
38 EXPECT_EQ(scale, matcher->scale()); | 38 EXPECT_EQ(scale, matcher->scale()); |
39 EXPECT_EQ(base, matcher->base()); | 39 EXPECT_EQ(base, matcher->base()); |
40 EXPECT_EQ(displacement, matcher->displacement()); | 40 EXPECT_EQ(displacement, matcher->displacement()); |
41 EXPECT_EQ(displacement_mode, matcher->displacement_mode()); | 41 EXPECT_EQ(displacement_mode, matcher->displacement_mode()); |
42 } | 42 } |
43 | 43 |
44 } // namespace | 44 } // namespace |
45 | 45 |
| 46 #define ADD_ADDRESSING_OPERAND_USES(node) \ |
| 47 graph()->NewNode(machine()->Load(MachineType::Int32()), node, d0, \ |
| 48 graph()->start(), graph()->start()); \ |
| 49 graph()->NewNode(machine()->Store(rep), node, d0, d0, graph()->start(), \ |
| 50 graph()->start()); \ |
| 51 graph()->NewNode(machine()->Int32Add(), node, d0); \ |
| 52 graph()->NewNode(machine()->Int64Add(), node, d0); |
| 53 |
| 54 #define ADD_NONE_ADDRESSING_OPERAND_USES(node) \ |
| 55 graph()->NewNode(machine()->Store(rep), b0, d0, node, graph()->start(), \ |
| 56 graph()->start()); |
46 | 57 |
47 TEST_F(NodeMatcherTest, ScaledWithOffset32Matcher) { | 58 TEST_F(NodeMatcherTest, ScaledWithOffset32Matcher) { |
48 graph()->SetStart(graph()->NewNode(common()->Start(0))); | 59 graph()->SetStart(graph()->NewNode(common()->Start(0))); |
49 | 60 |
50 const Operator* d0_op = common()->Int32Constant(0); | 61 const Operator* d0_op = common()->Int32Constant(0); |
51 Node* d0 = graph()->NewNode(d0_op); | 62 Node* d0 = graph()->NewNode(d0_op); |
52 USE(d0); | 63 USE(d0); |
53 const Operator* d1_op = common()->Int32Constant(1); | 64 const Operator* d1_op = common()->Int32Constant(1); |
54 Node* d1 = graph()->NewNode(d1_op); | 65 Node* d1 = graph()->NewNode(d1_op); |
55 USE(d1); | 66 USE(d1); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 Node* s1 = graph()->NewNode(s_op, p1, d1); | 129 Node* s1 = graph()->NewNode(s_op, p1, d1); |
119 Node* s2 = graph()->NewNode(s_op, p1, d2); | 130 Node* s2 = graph()->NewNode(s_op, p1, d2); |
120 Node* s3 = graph()->NewNode(s_op, p1, d3); | 131 Node* s3 = graph()->NewNode(s_op, p1, d3); |
121 Node* s4 = graph()->NewNode(s_op, p1, d4); | 132 Node* s4 = graph()->NewNode(s_op, p1, d4); |
122 USE(s0); | 133 USE(s0); |
123 USE(s1); | 134 USE(s1); |
124 USE(s2); | 135 USE(s2); |
125 USE(s3); | 136 USE(s3); |
126 USE(s4); | 137 USE(s4); |
127 | 138 |
| 139 const StoreRepresentation rep(MachineRepresentation::kWord32, |
| 140 kNoWriteBarrier); |
| 141 USE(rep); |
| 142 |
128 // 1 INPUT | 143 // 1 INPUT |
129 | 144 |
130 // Only relevant test dases is Checking for non-match. | 145 // Only relevant test dases is Checking for non-match. |
131 BaseWithIndexAndDisplacement32Matcher match0(d15); | 146 BaseWithIndexAndDisplacement32Matcher match0(d15); |
132 EXPECT_FALSE(match0.matches()); | 147 EXPECT_FALSE(match0.matches()); |
133 | 148 |
134 // 2 INPUT | 149 // 2 INPUT |
135 | 150 |
136 // (B0 + B1) -> [B0, 0, B1, NULL] | 151 // (B0 + B1) -> [B0, 0, B1, NULL] |
137 BaseWithIndexAndDisplacement32Matcher match1(graph()->NewNode(a_op, b0, b1)); | 152 BaseWithIndexAndDisplacement32Matcher match1(graph()->NewNode(a_op, b0, b1)); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 graph()->NewNode(a_op, b0, graph()->NewNode(sub_op, b1, d15))); | 386 graph()->NewNode(a_op, b0, graph()->NewNode(sub_op, b1, d15))); |
372 CheckBaseWithIndexAndDisplacement(&match45, b1, 0, b0, d15, | 387 CheckBaseWithIndexAndDisplacement(&match45, b1, 0, b0, d15, |
373 kNegativeDisplacement); | 388 kNegativeDisplacement); |
374 | 389 |
375 // (B0 - D15) + S3 -> [p1, 2, b0, d15, true] | 390 // (B0 - D15) + S3 -> [p1, 2, b0, d15, true] |
376 s3 = graph()->NewNode(s_op, p1, d3); | 391 s3 = graph()->NewNode(s_op, p1, d3); |
377 BaseWithIndexAndDisplacement32Matcher match46( | 392 BaseWithIndexAndDisplacement32Matcher match46( |
378 graph()->NewNode(a_op, graph()->NewNode(sub_op, b0, d15), s3)); | 393 graph()->NewNode(a_op, graph()->NewNode(sub_op, b0, d15), s3)); |
379 CheckBaseWithIndexAndDisplacement(&match46, p1, 3, b0, d15, | 394 CheckBaseWithIndexAndDisplacement(&match46, p1, 3, b0, d15, |
380 kNegativeDisplacement); | 395 kNegativeDisplacement); |
| 396 |
| 397 // 4 INPUT - with addressing operand uses |
| 398 |
| 399 // (B0 + M1) -> [p1, 0, B0, NULL] |
| 400 m1 = graph()->NewNode(m_op, p1, d1); |
| 401 ADD_ADDRESSING_OPERAND_USES(m1); |
| 402 BaseWithIndexAndDisplacement32Matcher match47(graph()->NewNode(a_op, b0, m1)); |
| 403 CheckBaseWithIndexAndDisplacement(&match47, p1, 0, b0, NULL); |
| 404 |
| 405 // (M1 + B0) -> [p1, 0, B0, NULL] |
| 406 m1 = graph()->NewNode(m_op, p1, d1); |
| 407 ADD_ADDRESSING_OPERAND_USES(m1); |
| 408 BaseWithIndexAndDisplacement32Matcher match48(graph()->NewNode(a_op, m1, b0)); |
| 409 CheckBaseWithIndexAndDisplacement(&match48, p1, 0, b0, NULL); |
| 410 |
| 411 // (D15 + M1) -> [P1, 0, NULL, D15] |
| 412 m1 = graph()->NewNode(m_op, p1, d1); |
| 413 ADD_ADDRESSING_OPERAND_USES(m1); |
| 414 BaseWithIndexAndDisplacement32Matcher match49( |
| 415 graph()->NewNode(a_op, d15, m1)); |
| 416 CheckBaseWithIndexAndDisplacement(&match49, p1, 0, NULL, d15); |
| 417 |
| 418 // (M1 + D15) -> [P1, 0, NULL, D15] |
| 419 m1 = graph()->NewNode(m_op, p1, d1); |
| 420 ADD_ADDRESSING_OPERAND_USES(m1); |
| 421 BaseWithIndexAndDisplacement32Matcher match50( |
| 422 graph()->NewNode(a_op, m1, d15)); |
| 423 CheckBaseWithIndexAndDisplacement(&match50, p1, 0, NULL, d15); |
| 424 |
| 425 // (B0 + S0) -> [p1, 0, B0, NULL] |
| 426 s0 = graph()->NewNode(s_op, p1, d0); |
| 427 ADD_ADDRESSING_OPERAND_USES(s0); |
| 428 BaseWithIndexAndDisplacement32Matcher match51(graph()->NewNode(a_op, b0, s0)); |
| 429 CheckBaseWithIndexAndDisplacement(&match51, p1, 0, b0, NULL); |
| 430 |
| 431 // (S0 + B0) -> [p1, 0, B0, NULL] |
| 432 s0 = graph()->NewNode(s_op, p1, d0); |
| 433 ADD_ADDRESSING_OPERAND_USES(s0); |
| 434 BaseWithIndexAndDisplacement32Matcher match52(graph()->NewNode(a_op, s0, b0)); |
| 435 CheckBaseWithIndexAndDisplacement(&match52, p1, 0, b0, NULL); |
| 436 |
| 437 // (D15 + S0) -> [P1, 0, NULL, D15] |
| 438 s0 = graph()->NewNode(s_op, p1, d0); |
| 439 ADD_ADDRESSING_OPERAND_USES(s0); |
| 440 BaseWithIndexAndDisplacement32Matcher match53( |
| 441 graph()->NewNode(a_op, d15, s0)); |
| 442 CheckBaseWithIndexAndDisplacement(&match53, p1, 0, NULL, d15); |
| 443 |
| 444 // (S0 + D15) -> [P1, 0, NULL, D15] |
| 445 s0 = graph()->NewNode(s_op, p1, d0); |
| 446 ADD_ADDRESSING_OPERAND_USES(s0); |
| 447 BaseWithIndexAndDisplacement32Matcher match54( |
| 448 graph()->NewNode(a_op, s0, d15)); |
| 449 CheckBaseWithIndexAndDisplacement(&match54, p1, 0, NULL, d15); |
| 450 |
| 451 // (B0 + M2) -> [p1, 1, B0, NULL] |
| 452 m2 = graph()->NewNode(m_op, p1, d2); |
| 453 ADD_ADDRESSING_OPERAND_USES(m2); |
| 454 BaseWithIndexAndDisplacement32Matcher match55(graph()->NewNode(a_op, b0, m2)); |
| 455 CheckBaseWithIndexAndDisplacement(&match55, p1, 1, b0, NULL); |
| 456 |
| 457 // (M2 + B0) -> [p1, 1, B0, NULL] |
| 458 m2 = graph()->NewNode(m_op, p1, d2); |
| 459 ADD_ADDRESSING_OPERAND_USES(m2); |
| 460 BaseWithIndexAndDisplacement32Matcher match56(graph()->NewNode(a_op, m2, b0)); |
| 461 CheckBaseWithIndexAndDisplacement(&match56, p1, 1, b0, NULL); |
| 462 |
| 463 // (D15 + M2) -> [P1, 1, NULL, D15] |
| 464 m2 = graph()->NewNode(m_op, p1, d2); |
| 465 ADD_ADDRESSING_OPERAND_USES(m2); |
| 466 BaseWithIndexAndDisplacement32Matcher match57( |
| 467 graph()->NewNode(a_op, d15, m2)); |
| 468 CheckBaseWithIndexAndDisplacement(&match57, p1, 1, NULL, d15); |
| 469 |
| 470 // (M2 + D15) -> [P1, 1, NULL, D15] |
| 471 m2 = graph()->NewNode(m_op, p1, d2); |
| 472 ADD_ADDRESSING_OPERAND_USES(m2); |
| 473 BaseWithIndexAndDisplacement32Matcher match58( |
| 474 graph()->NewNode(a_op, m2, d15)); |
| 475 CheckBaseWithIndexAndDisplacement(&match58, p1, 1, NULL, d15); |
| 476 |
| 477 // (B0 + S1) -> [p1, 1, B0, NULL] |
| 478 s1 = graph()->NewNode(s_op, p1, d1); |
| 479 ADD_ADDRESSING_OPERAND_USES(s1); |
| 480 BaseWithIndexAndDisplacement32Matcher match59(graph()->NewNode(a_op, b0, s1)); |
| 481 CheckBaseWithIndexAndDisplacement(&match59, p1, 1, b0, NULL); |
| 482 |
| 483 // (S1 + B0) -> [p1, 1, B0, NULL] |
| 484 s1 = graph()->NewNode(s_op, p1, d1); |
| 485 ADD_ADDRESSING_OPERAND_USES(s1); |
| 486 BaseWithIndexAndDisplacement32Matcher match60(graph()->NewNode(a_op, s1, b0)); |
| 487 CheckBaseWithIndexAndDisplacement(&match60, p1, 1, b0, NULL); |
| 488 |
| 489 // (D15 + S1) -> [P1, 1, NULL, D15] |
| 490 s1 = graph()->NewNode(s_op, p1, d1); |
| 491 ADD_ADDRESSING_OPERAND_USES(s1); |
| 492 BaseWithIndexAndDisplacement32Matcher match61( |
| 493 graph()->NewNode(a_op, d15, s1)); |
| 494 CheckBaseWithIndexAndDisplacement(&match61, p1, 1, NULL, d15); |
| 495 |
| 496 // (S1 + D15) -> [P1, 1, NULL, D15] |
| 497 s1 = graph()->NewNode(s_op, p1, d1); |
| 498 ADD_ADDRESSING_OPERAND_USES(s1); |
| 499 BaseWithIndexAndDisplacement32Matcher match62( |
| 500 graph()->NewNode(a_op, s1, d15)); |
| 501 CheckBaseWithIndexAndDisplacement(&match62, p1, 1, NULL, d15); |
| 502 |
| 503 // (B0 + M4) -> [p1, 2, B0, NULL] |
| 504 m4 = graph()->NewNode(m_op, p1, d4); |
| 505 ADD_ADDRESSING_OPERAND_USES(m4); |
| 506 BaseWithIndexAndDisplacement32Matcher match63(graph()->NewNode(a_op, b0, m4)); |
| 507 CheckBaseWithIndexAndDisplacement(&match63, p1, 2, b0, NULL); |
| 508 |
| 509 // (M4 + B0) -> [p1, 2, B0, NULL] |
| 510 m4 = graph()->NewNode(m_op, p1, d4); |
| 511 ADD_ADDRESSING_OPERAND_USES(m4); |
| 512 BaseWithIndexAndDisplacement32Matcher match64(graph()->NewNode(a_op, m4, b0)); |
| 513 CheckBaseWithIndexAndDisplacement(&match64, p1, 2, b0, NULL); |
| 514 |
| 515 // (D15 + M4) -> [p1, 2, NULL, D15] |
| 516 m4 = graph()->NewNode(m_op, p1, d4); |
| 517 ADD_ADDRESSING_OPERAND_USES(m4); |
| 518 BaseWithIndexAndDisplacement32Matcher match65( |
| 519 graph()->NewNode(a_op, d15, m4)); |
| 520 CheckBaseWithIndexAndDisplacement(&match65, p1, 2, NULL, d15); |
| 521 |
| 522 // (M4 + D15) -> [p1, 2, NULL, D15] |
| 523 m4 = graph()->NewNode(m_op, p1, d4); |
| 524 ADD_ADDRESSING_OPERAND_USES(m4); |
| 525 BaseWithIndexAndDisplacement32Matcher match66( |
| 526 graph()->NewNode(a_op, m4, d15)); |
| 527 CheckBaseWithIndexAndDisplacement(&match66, p1, 2, NULL, d15); |
| 528 |
| 529 // (B0 + S2) -> [p1, 2, B0, NULL] |
| 530 s2 = graph()->NewNode(s_op, p1, d2); |
| 531 ADD_ADDRESSING_OPERAND_USES(s2); |
| 532 BaseWithIndexAndDisplacement32Matcher match67(graph()->NewNode(a_op, b0, s2)); |
| 533 CheckBaseWithIndexAndDisplacement(&match67, p1, 2, b0, NULL); |
| 534 |
| 535 // (S2 + B0) -> [p1, 2, B0, NULL] |
| 536 s2 = graph()->NewNode(s_op, p1, d2); |
| 537 ADD_ADDRESSING_OPERAND_USES(s2); |
| 538 BaseWithIndexAndDisplacement32Matcher match68(graph()->NewNode(a_op, s2, b0)); |
| 539 CheckBaseWithIndexAndDisplacement(&match68, p1, 2, b0, NULL); |
| 540 |
| 541 // (D15 + S2) -> [p1, 2, NULL, D15] |
| 542 s2 = graph()->NewNode(s_op, p1, d2); |
| 543 ADD_ADDRESSING_OPERAND_USES(s2); |
| 544 BaseWithIndexAndDisplacement32Matcher match69( |
| 545 graph()->NewNode(a_op, d15, s2)); |
| 546 CheckBaseWithIndexAndDisplacement(&match69, p1, 2, NULL, d15); |
| 547 |
| 548 // (S2 + D15) -> [p1, 2, NULL, D15] |
| 549 s2 = graph()->NewNode(s_op, p1, d2); |
| 550 ADD_ADDRESSING_OPERAND_USES(s2); |
| 551 BaseWithIndexAndDisplacement32Matcher match70( |
| 552 graph()->NewNode(a_op, s2, d15)); |
| 553 CheckBaseWithIndexAndDisplacement(&match70, p1, 2, NULL, d15); |
| 554 |
| 555 // (B0 + M8) -> [p1, 2, B0, NULL] |
| 556 m8 = graph()->NewNode(m_op, p1, d8); |
| 557 ADD_ADDRESSING_OPERAND_USES(m8); |
| 558 BaseWithIndexAndDisplacement32Matcher match71(graph()->NewNode(a_op, b0, m8)); |
| 559 CheckBaseWithIndexAndDisplacement(&match71, p1, 3, b0, NULL); |
| 560 |
| 561 // (M8 + B0) -> [p1, 2, B0, NULL] |
| 562 m8 = graph()->NewNode(m_op, p1, d8); |
| 563 ADD_ADDRESSING_OPERAND_USES(m8); |
| 564 BaseWithIndexAndDisplacement32Matcher match72(graph()->NewNode(a_op, m8, b0)); |
| 565 CheckBaseWithIndexAndDisplacement(&match72, p1, 3, b0, NULL); |
| 566 |
| 567 // (D15 + M8) -> [p1, 2, NULL, D15] |
| 568 m8 = graph()->NewNode(m_op, p1, d8); |
| 569 ADD_ADDRESSING_OPERAND_USES(m8); |
| 570 BaseWithIndexAndDisplacement32Matcher match73( |
| 571 graph()->NewNode(a_op, d15, m8)); |
| 572 CheckBaseWithIndexAndDisplacement(&match73, p1, 3, NULL, d15); |
| 573 |
| 574 // (M8 + D15) -> [p1, 2, NULL, D15] |
| 575 m8 = graph()->NewNode(m_op, p1, d8); |
| 576 ADD_ADDRESSING_OPERAND_USES(m8); |
| 577 BaseWithIndexAndDisplacement32Matcher match74( |
| 578 graph()->NewNode(a_op, m8, d15)); |
| 579 CheckBaseWithIndexAndDisplacement(&match74, p1, 3, NULL, d15); |
| 580 |
| 581 // (B0 + S3) -> [p1, 2, B0, NULL] |
| 582 s3 = graph()->NewNode(s_op, p1, d3); |
| 583 ADD_ADDRESSING_OPERAND_USES(s3); |
| 584 BaseWithIndexAndDisplacement32Matcher match75(graph()->NewNode(a_op, b0, s3)); |
| 585 CheckBaseWithIndexAndDisplacement(&match75, p1, 3, b0, NULL); |
| 586 |
| 587 // (S3 + B0) -> [p1, 2, B0, NULL] |
| 588 s3 = graph()->NewNode(s_op, p1, d3); |
| 589 ADD_ADDRESSING_OPERAND_USES(s3); |
| 590 BaseWithIndexAndDisplacement32Matcher match76(graph()->NewNode(a_op, s3, b0)); |
| 591 CheckBaseWithIndexAndDisplacement(&match76, p1, 3, b0, NULL); |
| 592 |
| 593 // (D15 + S3) -> [p1, 2, NULL, D15] |
| 594 s3 = graph()->NewNode(s_op, p1, d3); |
| 595 ADD_ADDRESSING_OPERAND_USES(s3); |
| 596 BaseWithIndexAndDisplacement32Matcher match77( |
| 597 graph()->NewNode(a_op, d15, s3)); |
| 598 CheckBaseWithIndexAndDisplacement(&match77, p1, 3, NULL, d15); |
| 599 |
| 600 // (S3 + D15) -> [p1, 2, NULL, D15] |
| 601 s3 = graph()->NewNode(s_op, p1, d3); |
| 602 ADD_ADDRESSING_OPERAND_USES(s3); |
| 603 BaseWithIndexAndDisplacement32Matcher match78( |
| 604 graph()->NewNode(a_op, s3, d15)); |
| 605 CheckBaseWithIndexAndDisplacement(&match78, p1, 3, NULL, d15); |
| 606 |
| 607 // (D15 + S3) + B0 -> [p1, 2, b0, d15] |
| 608 s3 = graph()->NewNode(s_op, p1, d3); |
| 609 Node* temp = graph()->NewNode(a_op, d15, s3); |
| 610 ADD_ADDRESSING_OPERAND_USES(temp); |
| 611 BaseWithIndexAndDisplacement32Matcher match79( |
| 612 graph()->NewNode(a_op, temp, b0)); |
| 613 CheckBaseWithIndexAndDisplacement(&match79, p1, 3, b0, d15); |
| 614 |
| 615 // (B0 + D15) + S3 -> [p1, 2, b0, d15] |
| 616 s3 = graph()->NewNode(s_op, p1, d3); |
| 617 temp = graph()->NewNode(a_op, b0, d15); |
| 618 ADD_ADDRESSING_OPERAND_USES(temp); |
| 619 BaseWithIndexAndDisplacement32Matcher match80( |
| 620 graph()->NewNode(a_op, temp, s3)); |
| 621 CheckBaseWithIndexAndDisplacement(&match80, p1, 3, b0, d15); |
| 622 |
| 623 // (S3 + B0) + D15 -> [NULL, 0, (s3 + b0), d15] |
| 624 // Avoid changing simple addressing to complex addressing |
| 625 s3 = graph()->NewNode(s_op, p1, d3); |
| 626 temp = graph()->NewNode(a_op, s3, b0); |
| 627 ADD_ADDRESSING_OPERAND_USES(temp); |
| 628 BaseWithIndexAndDisplacement32Matcher match81( |
| 629 graph()->NewNode(a_op, temp, d15)); |
| 630 CheckBaseWithIndexAndDisplacement(&match81, NULL, 0, temp, d15); |
| 631 |
| 632 // D15 + (S3 + B0) -> [NULL, 0, (s3 + b0), d15] |
| 633 // Avoid changing simple addressing to complex addressing |
| 634 s3 = graph()->NewNode(s_op, p1, d3); |
| 635 temp = graph()->NewNode(a_op, s3, b0); |
| 636 ADD_ADDRESSING_OPERAND_USES(temp); |
| 637 BaseWithIndexAndDisplacement32Matcher match82( |
| 638 graph()->NewNode(a_op, d15, temp)); |
| 639 CheckBaseWithIndexAndDisplacement(&match82, NULL, 0, temp, d15); |
| 640 |
| 641 // B0 + (D15 + S3) -> [p1, 2, b0, d15] |
| 642 s3 = graph()->NewNode(s_op, p1, d3); |
| 643 temp = graph()->NewNode(a_op, d15, s3); |
| 644 ADD_ADDRESSING_OPERAND_USES(temp); |
| 645 BaseWithIndexAndDisplacement32Matcher match83( |
| 646 graph()->NewNode(a_op, b0, temp)); |
| 647 CheckBaseWithIndexAndDisplacement(&match83, p1, 3, b0, d15); |
| 648 |
| 649 // S3 + (B0 + D15) -> [p1, 2, b0, d15] |
| 650 s3 = graph()->NewNode(s_op, p1, d3); |
| 651 temp = graph()->NewNode(a_op, b0, d15); |
| 652 ADD_ADDRESSING_OPERAND_USES(temp); |
| 653 BaseWithIndexAndDisplacement32Matcher match84( |
| 654 graph()->NewNode(a_op, s3, temp)); |
| 655 CheckBaseWithIndexAndDisplacement(&match84, p1, 3, b0, d15); |
| 656 |
| 657 // S3 + (B0 - D15) -> [p1, 2, b0, d15, true] |
| 658 s3 = graph()->NewNode(s_op, p1, d3); |
| 659 temp = graph()->NewNode(sub_op, b0, d15); |
| 660 ADD_ADDRESSING_OPERAND_USES(temp); |
| 661 BaseWithIndexAndDisplacement32Matcher match85( |
| 662 graph()->NewNode(a_op, s3, temp)); |
| 663 CheckBaseWithIndexAndDisplacement(&match85, p1, 3, b0, d15, |
| 664 kNegativeDisplacement); |
| 665 |
| 666 // B0 + (B1 - D15) -> [p1, 2, b0, d15, true] |
| 667 temp = graph()->NewNode(sub_op, b1, d15); |
| 668 ADD_ADDRESSING_OPERAND_USES(temp); |
| 669 BaseWithIndexAndDisplacement32Matcher match86( |
| 670 graph()->NewNode(a_op, b0, temp)); |
| 671 CheckBaseWithIndexAndDisplacement(&match86, b1, 0, b0, d15, |
| 672 kNegativeDisplacement); |
| 673 |
| 674 // (B0 - D15) + S3 -> [p1, 2, b0, d15, true] |
| 675 s3 = graph()->NewNode(s_op, p1, d3); |
| 676 temp = graph()->NewNode(sub_op, b0, d15); |
| 677 ADD_ADDRESSING_OPERAND_USES(temp); |
| 678 BaseWithIndexAndDisplacement32Matcher match87( |
| 679 graph()->NewNode(a_op, temp, s3)); |
| 680 CheckBaseWithIndexAndDisplacement(&match87, p1, 3, b0, d15, |
| 681 kNegativeDisplacement); |
| 682 |
| 683 // (B0 + B1) + D15 -> [NULL, 0, (b0 + b1), d15] |
| 684 // Avoid changing simple addressing to complex addressing |
| 685 temp = graph()->NewNode(a_op, b0, b1); |
| 686 ADD_ADDRESSING_OPERAND_USES(temp); |
| 687 BaseWithIndexAndDisplacement32Matcher match88( |
| 688 graph()->NewNode(a_op, temp, d15)); |
| 689 CheckBaseWithIndexAndDisplacement(&match88, NULL, 0, temp, d15); |
| 690 |
| 691 // D15 + (B0 + B1) -> [NULL, 0, (b0 + b1), d15] |
| 692 // Avoid changing simple addressing to complex addressing |
| 693 temp = graph()->NewNode(a_op, b0, b1); |
| 694 ADD_ADDRESSING_OPERAND_USES(temp); |
| 695 BaseWithIndexAndDisplacement32Matcher match89( |
| 696 graph()->NewNode(a_op, d15, temp)); |
| 697 CheckBaseWithIndexAndDisplacement(&match89, NULL, 0, temp, d15); |
| 698 |
| 699 // 5 INPUT - with none-addressing operand uses |
| 700 |
| 701 // (B0 + M1) -> [b0, 0, m1, NULL] |
| 702 m1 = graph()->NewNode(m_op, p1, d1); |
| 703 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 704 BaseWithIndexAndDisplacement32Matcher match90(graph()->NewNode(a_op, b0, m1)); |
| 705 CheckBaseWithIndexAndDisplacement(&match90, b0, 0, m1, NULL); |
| 706 |
| 707 // (M1 + B0) -> [b0, 0, m1, NULL] |
| 708 m1 = graph()->NewNode(m_op, p1, d1); |
| 709 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 710 BaseWithIndexAndDisplacement32Matcher match91(graph()->NewNode(a_op, m1, b0)); |
| 711 CheckBaseWithIndexAndDisplacement(&match91, b0, 0, m1, NULL); |
| 712 |
| 713 // (D15 + M1) -> [NULL, 0, m1, d15] |
| 714 m1 = graph()->NewNode(m_op, p1, d1); |
| 715 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 716 BaseWithIndexAndDisplacement32Matcher match92( |
| 717 graph()->NewNode(a_op, d15, m1)); |
| 718 CheckBaseWithIndexAndDisplacement(&match92, NULL, 0, m1, d15); |
| 719 |
| 720 // (M1 + D15) -> [NULL, 0, m1, d15] |
| 721 m1 = graph()->NewNode(m_op, p1, d1); |
| 722 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 723 BaseWithIndexAndDisplacement32Matcher match93( |
| 724 graph()->NewNode(a_op, m1, d15)); |
| 725 CheckBaseWithIndexAndDisplacement(&match93, NULL, 0, m1, d15); |
| 726 |
| 727 // (B0 + S0) -> [b0, 0, s0, NULL] |
| 728 s0 = graph()->NewNode(s_op, p1, d0); |
| 729 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 730 BaseWithIndexAndDisplacement32Matcher match94(graph()->NewNode(a_op, b0, s0)); |
| 731 CheckBaseWithIndexAndDisplacement(&match94, b0, 0, s0, NULL); |
| 732 |
| 733 // (S0 + B0) -> [b0, 0, s0, NULL] |
| 734 s0 = graph()->NewNode(s_op, p1, d0); |
| 735 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 736 BaseWithIndexAndDisplacement32Matcher match95(graph()->NewNode(a_op, s0, b0)); |
| 737 CheckBaseWithIndexAndDisplacement(&match95, b0, 0, s0, NULL); |
| 738 |
| 739 // (D15 + S0) -> [NULL, 0, s0, d15] |
| 740 s0 = graph()->NewNode(s_op, p1, d0); |
| 741 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 742 BaseWithIndexAndDisplacement32Matcher match96( |
| 743 graph()->NewNode(a_op, d15, s0)); |
| 744 CheckBaseWithIndexAndDisplacement(&match96, NULL, 0, s0, d15); |
| 745 |
| 746 // (S0 + D15) -> [NULL, 0, s0, d15] |
| 747 s0 = graph()->NewNode(s_op, p1, d0); |
| 748 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 749 BaseWithIndexAndDisplacement32Matcher match97( |
| 750 graph()->NewNode(a_op, s0, d15)); |
| 751 CheckBaseWithIndexAndDisplacement(&match97, NULL, 0, s0, d15); |
| 752 |
| 753 // (B0 + M2) -> [b0, 0, m2, NULL] |
| 754 m2 = graph()->NewNode(m_op, p1, d2); |
| 755 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 756 BaseWithIndexAndDisplacement32Matcher match98(graph()->NewNode(a_op, b0, m2)); |
| 757 CheckBaseWithIndexAndDisplacement(&match98, b0, 0, m2, NULL); |
| 758 |
| 759 // (M2 + B0) -> [b0, 0, m2, NULL] |
| 760 m2 = graph()->NewNode(m_op, p1, d2); |
| 761 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 762 BaseWithIndexAndDisplacement32Matcher match99(graph()->NewNode(a_op, m2, b0)); |
| 763 CheckBaseWithIndexAndDisplacement(&match99, b0, 0, m2, NULL); |
| 764 |
| 765 // (D15 + M2) -> [NULL, 0, m2, d15] |
| 766 m2 = graph()->NewNode(m_op, p1, d2); |
| 767 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 768 BaseWithIndexAndDisplacement32Matcher match100( |
| 769 graph()->NewNode(a_op, d15, m2)); |
| 770 CheckBaseWithIndexAndDisplacement(&match100, NULL, 0, m2, d15); |
| 771 |
| 772 // (M2 + D15) -> [NULL, 0, m2, d15] |
| 773 m2 = graph()->NewNode(m_op, p1, d2); |
| 774 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 775 BaseWithIndexAndDisplacement32Matcher match101( |
| 776 graph()->NewNode(a_op, m2, d15)); |
| 777 CheckBaseWithIndexAndDisplacement(&match101, NULL, 0, m2, d15); |
| 778 |
| 779 // (B0 + S1) -> [b0, 0, s1, NULL] |
| 780 s1 = graph()->NewNode(s_op, p1, d1); |
| 781 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 782 BaseWithIndexAndDisplacement32Matcher match102( |
| 783 graph()->NewNode(a_op, b0, s1)); |
| 784 CheckBaseWithIndexAndDisplacement(&match102, b0, 0, s1, NULL); |
| 785 |
| 786 // (S1 + B0) -> [b0, 0, s1, NULL] |
| 787 s1 = graph()->NewNode(s_op, p1, d1); |
| 788 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 789 BaseWithIndexAndDisplacement32Matcher match103( |
| 790 graph()->NewNode(a_op, s1, b0)); |
| 791 CheckBaseWithIndexAndDisplacement(&match103, b0, 0, s1, NULL); |
| 792 |
| 793 // (D15 + S1) -> [NULL, 0, s1, d15] |
| 794 s1 = graph()->NewNode(s_op, p1, d1); |
| 795 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 796 BaseWithIndexAndDisplacement32Matcher match104( |
| 797 graph()->NewNode(a_op, d15, s1)); |
| 798 CheckBaseWithIndexAndDisplacement(&match104, NULL, 0, s1, d15); |
| 799 |
| 800 // (S1 + D15) -> [NULL, 0, s1, d15] |
| 801 s1 = graph()->NewNode(s_op, p1, d1); |
| 802 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 803 BaseWithIndexAndDisplacement32Matcher match105( |
| 804 graph()->NewNode(a_op, s1, d15)); |
| 805 CheckBaseWithIndexAndDisplacement(&match105, NULL, 0, s1, d15); |
| 806 |
| 807 // (B0 + M4) -> [b0, 0, m4, NULL] |
| 808 m4 = graph()->NewNode(m_op, p1, d4); |
| 809 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 810 BaseWithIndexAndDisplacement32Matcher match106( |
| 811 graph()->NewNode(a_op, b0, m4)); |
| 812 CheckBaseWithIndexAndDisplacement(&match106, b0, 0, m4, NULL); |
| 813 |
| 814 // (M4 + B0) -> [b0, 0, m4, NULL] |
| 815 m4 = graph()->NewNode(m_op, p1, d4); |
| 816 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 817 BaseWithIndexAndDisplacement32Matcher match107( |
| 818 graph()->NewNode(a_op, m4, b0)); |
| 819 CheckBaseWithIndexAndDisplacement(&match107, b0, 0, m4, NULL); |
| 820 |
| 821 // (D15 + M4) -> [NULL, 0, m4, d15] |
| 822 m4 = graph()->NewNode(m_op, p1, d4); |
| 823 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 824 BaseWithIndexAndDisplacement32Matcher match108( |
| 825 graph()->NewNode(a_op, d15, m4)); |
| 826 CheckBaseWithIndexAndDisplacement(&match108, NULL, 0, m4, d15); |
| 827 |
| 828 // (M4 + D15) -> [NULL, 0, m4, d15] |
| 829 m4 = graph()->NewNode(m_op, p1, d4); |
| 830 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 831 BaseWithIndexAndDisplacement32Matcher match109( |
| 832 graph()->NewNode(a_op, m4, d15)); |
| 833 CheckBaseWithIndexAndDisplacement(&match109, NULL, 0, m4, d15); |
| 834 |
| 835 // (B0 + S2) -> [b0, 0, s2, NULL] |
| 836 s2 = graph()->NewNode(s_op, p1, d2); |
| 837 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 838 BaseWithIndexAndDisplacement32Matcher match110( |
| 839 graph()->NewNode(a_op, b0, s2)); |
| 840 CheckBaseWithIndexAndDisplacement(&match110, b0, 0, s2, NULL); |
| 841 |
| 842 // (S2 + B0) -> [b0, 0, s2, NULL] |
| 843 s2 = graph()->NewNode(s_op, p1, d2); |
| 844 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 845 BaseWithIndexAndDisplacement32Matcher match111( |
| 846 graph()->NewNode(a_op, s2, b0)); |
| 847 CheckBaseWithIndexAndDisplacement(&match111, b0, 0, s2, NULL); |
| 848 |
| 849 // (D15 + S2) -> [NULL, 0, s2, d15] |
| 850 s2 = graph()->NewNode(s_op, p1, d2); |
| 851 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 852 BaseWithIndexAndDisplacement32Matcher match112( |
| 853 graph()->NewNode(a_op, d15, s2)); |
| 854 CheckBaseWithIndexAndDisplacement(&match112, NULL, 0, s2, d15); |
| 855 |
| 856 // (S2 + D15) -> [NULL, 0, s2, d15] |
| 857 s2 = graph()->NewNode(s_op, p1, d2); |
| 858 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 859 BaseWithIndexAndDisplacement32Matcher match113( |
| 860 graph()->NewNode(a_op, s2, d15)); |
| 861 CheckBaseWithIndexAndDisplacement(&match113, NULL, 0, s2, d15); |
| 862 |
| 863 // (B0 + M8) -> [b0, 0, m8, NULL] |
| 864 m8 = graph()->NewNode(m_op, p1, d8); |
| 865 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 866 BaseWithIndexAndDisplacement32Matcher match114( |
| 867 graph()->NewNode(a_op, b0, m8)); |
| 868 CheckBaseWithIndexAndDisplacement(&match114, b0, 0, m8, NULL); |
| 869 |
| 870 // (M8 + B0) -> [b0, 0, m8, NULL] |
| 871 m8 = graph()->NewNode(m_op, p1, d8); |
| 872 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 873 BaseWithIndexAndDisplacement32Matcher match115( |
| 874 graph()->NewNode(a_op, m8, b0)); |
| 875 CheckBaseWithIndexAndDisplacement(&match115, b0, 0, m8, NULL); |
| 876 |
| 877 // (D15 + M8) -> [NULL, 0, m8, d15] |
| 878 m8 = graph()->NewNode(m_op, p1, d8); |
| 879 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 880 BaseWithIndexAndDisplacement32Matcher match116( |
| 881 graph()->NewNode(a_op, d15, m8)); |
| 882 CheckBaseWithIndexAndDisplacement(&match116, NULL, 0, m8, d15); |
| 883 |
| 884 // (M8 + D15) -> [NULL, 0, m8, d15] |
| 885 m8 = graph()->NewNode(m_op, p1, d8); |
| 886 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 887 BaseWithIndexAndDisplacement32Matcher match117( |
| 888 graph()->NewNode(a_op, m8, d15)); |
| 889 CheckBaseWithIndexAndDisplacement(&match117, NULL, 0, m8, d15); |
| 890 |
| 891 // (B0 + S3) -> [b0, 0, s3, NULL] |
| 892 s3 = graph()->NewNode(s_op, p1, d3); |
| 893 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 894 BaseWithIndexAndDisplacement32Matcher match118( |
| 895 graph()->NewNode(a_op, b0, s3)); |
| 896 CheckBaseWithIndexAndDisplacement(&match118, b0, 0, s3, NULL); |
| 897 |
| 898 // (S3 + B0) -> [b0, 0, s3, NULL] |
| 899 s3 = graph()->NewNode(s_op, p1, d3); |
| 900 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 901 BaseWithIndexAndDisplacement32Matcher match119( |
| 902 graph()->NewNode(a_op, s3, b0)); |
| 903 CheckBaseWithIndexAndDisplacement(&match119, b0, 0, s3, NULL); |
| 904 |
| 905 // (D15 + S3) -> [NULL, 0, s3, d15] |
| 906 s3 = graph()->NewNode(s_op, p1, d3); |
| 907 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 908 BaseWithIndexAndDisplacement32Matcher match120( |
| 909 graph()->NewNode(a_op, d15, s3)); |
| 910 CheckBaseWithIndexAndDisplacement(&match120, NULL, 0, s3, d15); |
| 911 |
| 912 // (S3 + D15) -> [NULL, 0, s3, d15] |
| 913 s3 = graph()->NewNode(s_op, p1, d3); |
| 914 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 915 BaseWithIndexAndDisplacement32Matcher match121( |
| 916 graph()->NewNode(a_op, s3, d15)); |
| 917 CheckBaseWithIndexAndDisplacement(&match121, NULL, 0, s3, d15); |
| 918 |
| 919 // (D15 + S3) + B0 -> [b0, 0, (D15 + S3), NULL] |
| 920 s3 = graph()->NewNode(s_op, p1, d3); |
| 921 temp = graph()->NewNode(a_op, d15, s3); |
| 922 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 923 BaseWithIndexAndDisplacement32Matcher match122( |
| 924 graph()->NewNode(a_op, temp, b0)); |
| 925 CheckBaseWithIndexAndDisplacement(&match122, b0, 0, temp, NULL); |
| 926 |
| 927 // (B0 + D15) + S3 -> [p1, 3, (B0 + D15), NULL] |
| 928 s3 = graph()->NewNode(s_op, p1, d3); |
| 929 temp = graph()->NewNode(a_op, b0, d15); |
| 930 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 931 BaseWithIndexAndDisplacement32Matcher match123( |
| 932 graph()->NewNode(a_op, temp, s3)); |
| 933 CheckBaseWithIndexAndDisplacement(&match123, p1, 3, temp, NULL); |
| 934 |
| 935 // (S3 + B0) + D15 -> [NULL, 0, (S3 + B0), d15] |
| 936 s3 = graph()->NewNode(s_op, p1, d3); |
| 937 temp = graph()->NewNode(a_op, s3, b0); |
| 938 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 939 BaseWithIndexAndDisplacement32Matcher match124( |
| 940 graph()->NewNode(a_op, temp, d15)); |
| 941 CheckBaseWithIndexAndDisplacement(&match124, NULL, 0, temp, d15); |
| 942 |
| 943 // D15 + (S3 + B0) -> [NULL, 0, (S3 + B0), d15] |
| 944 s3 = graph()->NewNode(s_op, p1, d3); |
| 945 temp = graph()->NewNode(a_op, s3, b0); |
| 946 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 947 BaseWithIndexAndDisplacement32Matcher match125( |
| 948 graph()->NewNode(a_op, d15, temp)); |
| 949 CheckBaseWithIndexAndDisplacement(&match125, NULL, 0, temp, d15); |
| 950 |
| 951 // B0 + (D15 + S3) -> [b0, 0, (D15 + S3), NULL] |
| 952 s3 = graph()->NewNode(s_op, p1, d3); |
| 953 temp = graph()->NewNode(a_op, d15, s3); |
| 954 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 955 BaseWithIndexAndDisplacement32Matcher match126( |
| 956 graph()->NewNode(a_op, b0, temp)); |
| 957 CheckBaseWithIndexAndDisplacement(&match126, b0, 0, temp, NULL); |
| 958 |
| 959 // S3 + (B0 + D15) -> [p1, 3, (B0 + D15), NULL] |
| 960 s3 = graph()->NewNode(s_op, p1, d3); |
| 961 temp = graph()->NewNode(a_op, b0, d15); |
| 962 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 963 BaseWithIndexAndDisplacement32Matcher match127( |
| 964 graph()->NewNode(a_op, s3, temp)); |
| 965 CheckBaseWithIndexAndDisplacement(&match127, p1, 3, temp, NULL); |
| 966 |
| 967 // S3 + (B0 - D15) -> [p1, 3, (B0 - D15), NULL] |
| 968 s3 = graph()->NewNode(s_op, p1, d3); |
| 969 temp = graph()->NewNode(sub_op, b0, d15); |
| 970 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 971 BaseWithIndexAndDisplacement32Matcher match128( |
| 972 graph()->NewNode(a_op, s3, temp)); |
| 973 CheckBaseWithIndexAndDisplacement(&match128, p1, 3, temp, NULL); |
| 974 |
| 975 // B0 + (B1 - D15) -> [b0, 0, (B1 - D15), NULL] |
| 976 temp = graph()->NewNode(sub_op, b1, d15); |
| 977 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 978 BaseWithIndexAndDisplacement32Matcher match129( |
| 979 graph()->NewNode(a_op, b0, temp)); |
| 980 CheckBaseWithIndexAndDisplacement(&match129, b0, 0, temp, NULL); |
| 981 |
| 982 // (B0 - D15) + S3 -> [p1, 3, temp, NULL] |
| 983 s3 = graph()->NewNode(s_op, p1, d3); |
| 984 temp = graph()->NewNode(sub_op, b0, d15); |
| 985 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 986 BaseWithIndexAndDisplacement32Matcher match130( |
| 987 graph()->NewNode(a_op, temp, s3)); |
| 988 CheckBaseWithIndexAndDisplacement(&match130, p1, 3, temp, NULL); |
| 989 |
| 990 // (B0 + B1) + D15 -> [NULL, 0, (B0 + B1), d15] |
| 991 temp = graph()->NewNode(a_op, b0, b1); |
| 992 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 993 BaseWithIndexAndDisplacement32Matcher match131( |
| 994 graph()->NewNode(a_op, temp, d15)); |
| 995 CheckBaseWithIndexAndDisplacement(&match131, NULL, 0, temp, d15); |
| 996 |
| 997 // D15 + (B0 + B1) -> [NULL, 0, (B0 + B1), d15] |
| 998 temp = graph()->NewNode(a_op, b0, b1); |
| 999 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1000 BaseWithIndexAndDisplacement32Matcher match132( |
| 1001 graph()->NewNode(a_op, d15, temp)); |
| 1002 CheckBaseWithIndexAndDisplacement(&match132, NULL, 0, temp, d15); |
381 } | 1003 } |
382 | 1004 |
383 | 1005 |
384 TEST_F(NodeMatcherTest, ScaledWithOffset64Matcher) { | 1006 TEST_F(NodeMatcherTest, ScaledWithOffset64Matcher) { |
385 graph()->SetStart(graph()->NewNode(common()->Start(0))); | 1007 graph()->SetStart(graph()->NewNode(common()->Start(0))); |
386 | 1008 |
387 const Operator* d0_op = common()->Int64Constant(0); | 1009 const Operator* d0_op = common()->Int64Constant(0); |
388 Node* d0 = graph()->NewNode(d0_op); | 1010 Node* d0 = graph()->NewNode(d0_op); |
389 USE(d0); | 1011 USE(d0); |
390 const Operator* d1_op = common()->Int64Constant(1); | 1012 const Operator* d1_op = common()->Int64Constant(1); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 Node* s1 = graph()->NewNode(s_op, p1, d1); | 1080 Node* s1 = graph()->NewNode(s_op, p1, d1); |
459 Node* s2 = graph()->NewNode(s_op, p1, d2); | 1081 Node* s2 = graph()->NewNode(s_op, p1, d2); |
460 Node* s3 = graph()->NewNode(s_op, p1, d3); | 1082 Node* s3 = graph()->NewNode(s_op, p1, d3); |
461 Node* s4 = graph()->NewNode(s_op, p1, d4); | 1083 Node* s4 = graph()->NewNode(s_op, p1, d4); |
462 USE(s0); | 1084 USE(s0); |
463 USE(s1); | 1085 USE(s1); |
464 USE(s2); | 1086 USE(s2); |
465 USE(s3); | 1087 USE(s3); |
466 USE(s4); | 1088 USE(s4); |
467 | 1089 |
| 1090 const StoreRepresentation rep(MachineRepresentation::kWord32, |
| 1091 kNoWriteBarrier); |
| 1092 USE(rep); |
| 1093 |
468 // 1 INPUT | 1094 // 1 INPUT |
469 | 1095 |
470 // Only relevant test dases is Checking for non-match. | 1096 // Only relevant test dases is Checking for non-match. |
471 BaseWithIndexAndDisplacement64Matcher match0(d15); | 1097 BaseWithIndexAndDisplacement64Matcher match0(d15); |
472 EXPECT_FALSE(match0.matches()); | 1098 EXPECT_FALSE(match0.matches()); |
473 | 1099 |
474 // 2 INPUT | 1100 // 2 INPUT |
475 | 1101 |
476 // (B0 + B1) -> [B0, 0, B1, NULL] | 1102 // (B0 + B1) -> [B0, 0, B1, NULL] |
477 BaseWithIndexAndDisplacement64Matcher match1(graph()->NewNode(a_op, b0, b1)); | 1103 BaseWithIndexAndDisplacement64Matcher match1(graph()->NewNode(a_op, b0, b1)); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 graph()->NewNode(a_op, d15, m8)); | 1254 graph()->NewNode(a_op, d15, m8)); |
629 CheckBaseWithIndexAndDisplacement(&match30, p1, 3, NULL, d15); | 1255 CheckBaseWithIndexAndDisplacement(&match30, p1, 3, NULL, d15); |
630 | 1256 |
631 // (M8 + D15) -> [p1, 2, NULL, D15] | 1257 // (M8 + D15) -> [p1, 2, NULL, D15] |
632 m8 = graph()->NewNode(m_op, p1, d8); | 1258 m8 = graph()->NewNode(m_op, p1, d8); |
633 BaseWithIndexAndDisplacement64Matcher match31( | 1259 BaseWithIndexAndDisplacement64Matcher match31( |
634 graph()->NewNode(a_op, m8, d15)); | 1260 graph()->NewNode(a_op, m8, d15)); |
635 CheckBaseWithIndexAndDisplacement(&match31, p1, 3, NULL, d15); | 1261 CheckBaseWithIndexAndDisplacement(&match31, p1, 3, NULL, d15); |
636 | 1262 |
637 // (B0 + S3) -> [p1, 2, B0, NULL] | 1263 // (B0 + S3) -> [p1, 2, B0, NULL] |
638 BaseWithIndexAndDisplacement64Matcher match64(graph()->NewNode(a_op, b0, s3)); | 1264 BaseWithIndexAndDisplacement64Matcher match32(graph()->NewNode(a_op, b0, s3)); |
639 CheckBaseWithIndexAndDisplacement(&match64, p1, 3, b0, NULL); | 1265 CheckBaseWithIndexAndDisplacement(&match32, p1, 3, b0, NULL); |
640 | 1266 |
641 // (S3 + B0) -> [p1, 2, B0, NULL] | 1267 // (S3 + B0) -> [p1, 2, B0, NULL] |
642 s3 = graph()->NewNode(s_op, p1, d3); | 1268 s3 = graph()->NewNode(s_op, p1, d3); |
643 BaseWithIndexAndDisplacement64Matcher match33(graph()->NewNode(a_op, s3, b0)); | 1269 BaseWithIndexAndDisplacement64Matcher match33(graph()->NewNode(a_op, s3, b0)); |
644 CheckBaseWithIndexAndDisplacement(&match33, p1, 3, b0, NULL); | 1270 CheckBaseWithIndexAndDisplacement(&match33, p1, 3, b0, NULL); |
645 | 1271 |
646 // (D15 + S3) -> [p1, 2, NULL, D15] | 1272 // (D15 + S3) -> [p1, 2, NULL, D15] |
647 s3 = graph()->NewNode(s_op, p1, d3); | 1273 s3 = graph()->NewNode(s_op, p1, d3); |
648 BaseWithIndexAndDisplacement64Matcher match34( | 1274 BaseWithIndexAndDisplacement64Matcher match34( |
649 graph()->NewNode(a_op, d15, s3)); | 1275 graph()->NewNode(a_op, d15, s3)); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 graph()->NewNode(a_op, b0, graph()->NewNode(sub_op, b1, d15))); | 1391 graph()->NewNode(a_op, b0, graph()->NewNode(sub_op, b1, d15))); |
766 CheckBaseWithIndexAndDisplacement(&match52, b1, 0, b0, d15, | 1392 CheckBaseWithIndexAndDisplacement(&match52, b1, 0, b0, d15, |
767 kNegativeDisplacement); | 1393 kNegativeDisplacement); |
768 | 1394 |
769 // (B0 - D15) + S3 -> [p1, 2, b0, d15, true] | 1395 // (B0 - D15) + S3 -> [p1, 2, b0, d15, true] |
770 s3 = graph()->NewNode(s_op, p1, d3); | 1396 s3 = graph()->NewNode(s_op, p1, d3); |
771 BaseWithIndexAndDisplacement64Matcher match53( | 1397 BaseWithIndexAndDisplacement64Matcher match53( |
772 graph()->NewNode(a_op, graph()->NewNode(sub_op, b0, d15), s3)); | 1398 graph()->NewNode(a_op, graph()->NewNode(sub_op, b0, d15), s3)); |
773 CheckBaseWithIndexAndDisplacement(&match53, p1, 3, b0, d15, | 1399 CheckBaseWithIndexAndDisplacement(&match53, p1, 3, b0, d15, |
774 kNegativeDisplacement); | 1400 kNegativeDisplacement); |
| 1401 |
| 1402 // 4 INPUT - with addressing operand uses |
| 1403 |
| 1404 // (B0 + M1) -> [p1, 0, B0, NULL] |
| 1405 m1 = graph()->NewNode(m_op, p1, d1); |
| 1406 ADD_ADDRESSING_OPERAND_USES(m1); |
| 1407 BaseWithIndexAndDisplacement64Matcher match54(graph()->NewNode(a_op, b0, m1)); |
| 1408 CheckBaseWithIndexAndDisplacement(&match54, p1, 0, b0, NULL); |
| 1409 |
| 1410 // (M1 + B0) -> [p1, 0, B0, NULL] |
| 1411 m1 = graph()->NewNode(m_op, p1, d1); |
| 1412 ADD_ADDRESSING_OPERAND_USES(m1); |
| 1413 BaseWithIndexAndDisplacement64Matcher match55(graph()->NewNode(a_op, m1, b0)); |
| 1414 CheckBaseWithIndexAndDisplacement(&match55, p1, 0, b0, NULL); |
| 1415 |
| 1416 // (D15 + M1) -> [P1, 0, NULL, D15] |
| 1417 m1 = graph()->NewNode(m_op, p1, d1); |
| 1418 ADD_ADDRESSING_OPERAND_USES(m1); |
| 1419 BaseWithIndexAndDisplacement64Matcher match56( |
| 1420 graph()->NewNode(a_op, d15, m1)); |
| 1421 CheckBaseWithIndexAndDisplacement(&match56, p1, 0, NULL, d15); |
| 1422 |
| 1423 // (M1 + D15) -> [P1, 0, NULL, D15] |
| 1424 m1 = graph()->NewNode(m_op, p1, d1); |
| 1425 ADD_ADDRESSING_OPERAND_USES(m1); |
| 1426 BaseWithIndexAndDisplacement64Matcher match57( |
| 1427 graph()->NewNode(a_op, m1, d15)); |
| 1428 CheckBaseWithIndexAndDisplacement(&match57, p1, 0, NULL, d15); |
| 1429 |
| 1430 // (B0 + S0) -> [p1, 0, B0, NULL] |
| 1431 s0 = graph()->NewNode(s_op, p1, d0); |
| 1432 ADD_ADDRESSING_OPERAND_USES(s0); |
| 1433 BaseWithIndexAndDisplacement64Matcher match58(graph()->NewNode(a_op, b0, s0)); |
| 1434 CheckBaseWithIndexAndDisplacement(&match58, p1, 0, b0, NULL); |
| 1435 |
| 1436 // (S0 + B0) -> [p1, 0, B0, NULL] |
| 1437 s0 = graph()->NewNode(s_op, p1, d0); |
| 1438 ADD_ADDRESSING_OPERAND_USES(s0); |
| 1439 BaseWithIndexAndDisplacement64Matcher match59(graph()->NewNode(a_op, s0, b0)); |
| 1440 CheckBaseWithIndexAndDisplacement(&match59, p1, 0, b0, NULL); |
| 1441 |
| 1442 // (D15 + S0) -> [P1, 0, NULL, D15] |
| 1443 s0 = graph()->NewNode(s_op, p1, d0); |
| 1444 ADD_ADDRESSING_OPERAND_USES(s0); |
| 1445 BaseWithIndexAndDisplacement64Matcher match60( |
| 1446 graph()->NewNode(a_op, d15, s0)); |
| 1447 CheckBaseWithIndexAndDisplacement(&match60, p1, 0, NULL, d15); |
| 1448 |
| 1449 // (S0 + D15) -> [P1, 0, NULL, D15] |
| 1450 s0 = graph()->NewNode(s_op, p1, d0); |
| 1451 ADD_ADDRESSING_OPERAND_USES(s0); |
| 1452 BaseWithIndexAndDisplacement64Matcher match61( |
| 1453 graph()->NewNode(a_op, s0, d15)); |
| 1454 CheckBaseWithIndexAndDisplacement(&match61, p1, 0, NULL, d15); |
| 1455 |
| 1456 // (B0 + M2) -> [p1, 1, B0, NULL] |
| 1457 m2 = graph()->NewNode(m_op, p1, d2); |
| 1458 ADD_ADDRESSING_OPERAND_USES(m2); |
| 1459 BaseWithIndexAndDisplacement64Matcher match62(graph()->NewNode(a_op, b0, m2)); |
| 1460 CheckBaseWithIndexAndDisplacement(&match62, p1, 1, b0, NULL); |
| 1461 |
| 1462 // (M2 + B0) -> [p1, 1, B0, NULL] |
| 1463 m2 = graph()->NewNode(m_op, p1, d2); |
| 1464 ADD_ADDRESSING_OPERAND_USES(m2); |
| 1465 BaseWithIndexAndDisplacement64Matcher match63(graph()->NewNode(a_op, m2, b0)); |
| 1466 CheckBaseWithIndexAndDisplacement(&match63, p1, 1, b0, NULL); |
| 1467 |
| 1468 // (D15 + M2) -> [P1, 1, NULL, D15] |
| 1469 m2 = graph()->NewNode(m_op, p1, d2); |
| 1470 ADD_ADDRESSING_OPERAND_USES(m2); |
| 1471 BaseWithIndexAndDisplacement64Matcher match64( |
| 1472 graph()->NewNode(a_op, d15, m2)); |
| 1473 CheckBaseWithIndexAndDisplacement(&match64, p1, 1, NULL, d15); |
| 1474 |
| 1475 // (M2 + D15) -> [P1, 1, NULL, D15] |
| 1476 m2 = graph()->NewNode(m_op, p1, d2); |
| 1477 ADD_ADDRESSING_OPERAND_USES(m2); |
| 1478 BaseWithIndexAndDisplacement64Matcher match65( |
| 1479 graph()->NewNode(a_op, m2, d15)); |
| 1480 CheckBaseWithIndexAndDisplacement(&match65, p1, 1, NULL, d15); |
| 1481 |
| 1482 // (B0 + S1) -> [p1, 1, B0, NULL] |
| 1483 s1 = graph()->NewNode(s_op, p1, d1); |
| 1484 ADD_ADDRESSING_OPERAND_USES(s1); |
| 1485 BaseWithIndexAndDisplacement64Matcher match66(graph()->NewNode(a_op, b0, s1)); |
| 1486 CheckBaseWithIndexAndDisplacement(&match66, p1, 1, b0, NULL); |
| 1487 |
| 1488 // (S1 + B0) -> [p1, 1, B0, NULL] |
| 1489 s1 = graph()->NewNode(s_op, p1, d1); |
| 1490 ADD_ADDRESSING_OPERAND_USES(s1); |
| 1491 BaseWithIndexAndDisplacement64Matcher match67(graph()->NewNode(a_op, s1, b0)); |
| 1492 CheckBaseWithIndexAndDisplacement(&match67, p1, 1, b0, NULL); |
| 1493 |
| 1494 // (D15 + S1) -> [P1, 1, NULL, D15] |
| 1495 s1 = graph()->NewNode(s_op, p1, d1); |
| 1496 ADD_ADDRESSING_OPERAND_USES(s1); |
| 1497 BaseWithIndexAndDisplacement64Matcher match68( |
| 1498 graph()->NewNode(a_op, d15, s1)); |
| 1499 CheckBaseWithIndexAndDisplacement(&match68, p1, 1, NULL, d15); |
| 1500 |
| 1501 // (S1 + D15) -> [P1, 1, NULL, D15] |
| 1502 s1 = graph()->NewNode(s_op, p1, d1); |
| 1503 ADD_ADDRESSING_OPERAND_USES(s1); |
| 1504 BaseWithIndexAndDisplacement64Matcher match69( |
| 1505 graph()->NewNode(a_op, s1, d15)); |
| 1506 CheckBaseWithIndexAndDisplacement(&match69, p1, 1, NULL, d15); |
| 1507 |
| 1508 // (B0 + M4) -> [p1, 2, B0, NULL] |
| 1509 m4 = graph()->NewNode(m_op, p1, d4); |
| 1510 ADD_ADDRESSING_OPERAND_USES(m4); |
| 1511 BaseWithIndexAndDisplacement64Matcher match70(graph()->NewNode(a_op, b0, m4)); |
| 1512 CheckBaseWithIndexAndDisplacement(&match70, p1, 2, b0, NULL); |
| 1513 |
| 1514 // (M4 + B0) -> [p1, 2, B0, NULL] |
| 1515 m4 = graph()->NewNode(m_op, p1, d4); |
| 1516 ADD_ADDRESSING_OPERAND_USES(m4); |
| 1517 BaseWithIndexAndDisplacement64Matcher match71(graph()->NewNode(a_op, m4, b0)); |
| 1518 CheckBaseWithIndexAndDisplacement(&match71, p1, 2, b0, NULL); |
| 1519 |
| 1520 // (D15 + M4) -> [p1, 2, NULL, D15] |
| 1521 m4 = graph()->NewNode(m_op, p1, d4); |
| 1522 ADD_ADDRESSING_OPERAND_USES(m4); |
| 1523 BaseWithIndexAndDisplacement64Matcher match72( |
| 1524 graph()->NewNode(a_op, d15, m4)); |
| 1525 CheckBaseWithIndexAndDisplacement(&match72, p1, 2, NULL, d15); |
| 1526 |
| 1527 // (M4 + D15) -> [p1, 2, NULL, D15] |
| 1528 m4 = graph()->NewNode(m_op, p1, d4); |
| 1529 ADD_ADDRESSING_OPERAND_USES(m4); |
| 1530 BaseWithIndexAndDisplacement64Matcher match73( |
| 1531 graph()->NewNode(a_op, m4, d15)); |
| 1532 CheckBaseWithIndexAndDisplacement(&match73, p1, 2, NULL, d15); |
| 1533 |
| 1534 // (B0 + S2) -> [p1, 2, B0, NULL] |
| 1535 s2 = graph()->NewNode(s_op, p1, d2); |
| 1536 ADD_ADDRESSING_OPERAND_USES(s2); |
| 1537 BaseWithIndexAndDisplacement64Matcher match74(graph()->NewNode(a_op, b0, s2)); |
| 1538 CheckBaseWithIndexAndDisplacement(&match74, p1, 2, b0, NULL); |
| 1539 |
| 1540 // (S2 + B0) -> [p1, 2, B0, NULL] |
| 1541 s2 = graph()->NewNode(s_op, p1, d2); |
| 1542 ADD_ADDRESSING_OPERAND_USES(s2); |
| 1543 BaseWithIndexAndDisplacement64Matcher match75(graph()->NewNode(a_op, s2, b0)); |
| 1544 CheckBaseWithIndexAndDisplacement(&match75, p1, 2, b0, NULL); |
| 1545 |
| 1546 // (D15 + S2) -> [p1, 2, NULL, D15] |
| 1547 s2 = graph()->NewNode(s_op, p1, d2); |
| 1548 ADD_ADDRESSING_OPERAND_USES(s2); |
| 1549 BaseWithIndexAndDisplacement64Matcher match76( |
| 1550 graph()->NewNode(a_op, d15, s2)); |
| 1551 CheckBaseWithIndexAndDisplacement(&match76, p1, 2, NULL, d15); |
| 1552 |
| 1553 // (S2 + D15) -> [p1, 2, NULL, D15] |
| 1554 s2 = graph()->NewNode(s_op, p1, d2); |
| 1555 ADD_ADDRESSING_OPERAND_USES(s2); |
| 1556 BaseWithIndexAndDisplacement64Matcher match77( |
| 1557 graph()->NewNode(a_op, s2, d15)); |
| 1558 CheckBaseWithIndexAndDisplacement(&match77, p1, 2, NULL, d15); |
| 1559 |
| 1560 // (B0 + M8) -> [p1, 2, B0, NULL] |
| 1561 m8 = graph()->NewNode(m_op, p1, d8); |
| 1562 ADD_ADDRESSING_OPERAND_USES(m8); |
| 1563 BaseWithIndexAndDisplacement64Matcher match78(graph()->NewNode(a_op, b0, m8)); |
| 1564 CheckBaseWithIndexAndDisplacement(&match78, p1, 3, b0, NULL); |
| 1565 |
| 1566 // (M8 + B0) -> [p1, 2, B0, NULL] |
| 1567 m8 = graph()->NewNode(m_op, p1, d8); |
| 1568 ADD_ADDRESSING_OPERAND_USES(m8); |
| 1569 BaseWithIndexAndDisplacement64Matcher match79(graph()->NewNode(a_op, m8, b0)); |
| 1570 CheckBaseWithIndexAndDisplacement(&match79, p1, 3, b0, NULL); |
| 1571 |
| 1572 // (D15 + M8) -> [p1, 2, NULL, D15] |
| 1573 m8 = graph()->NewNode(m_op, p1, d8); |
| 1574 ADD_ADDRESSING_OPERAND_USES(m8); |
| 1575 BaseWithIndexAndDisplacement64Matcher match80( |
| 1576 graph()->NewNode(a_op, d15, m8)); |
| 1577 CheckBaseWithIndexAndDisplacement(&match80, p1, 3, NULL, d15); |
| 1578 |
| 1579 // (M8 + D15) -> [p1, 2, NULL, D15] |
| 1580 m8 = graph()->NewNode(m_op, p1, d8); |
| 1581 ADD_ADDRESSING_OPERAND_USES(m8); |
| 1582 BaseWithIndexAndDisplacement64Matcher match81( |
| 1583 graph()->NewNode(a_op, m8, d15)); |
| 1584 CheckBaseWithIndexAndDisplacement(&match81, p1, 3, NULL, d15); |
| 1585 |
| 1586 // (B0 + S3) -> [p1, 2, B0, NULL] |
| 1587 s3 = graph()->NewNode(s_op, p1, d3); |
| 1588 ADD_ADDRESSING_OPERAND_USES(s3); |
| 1589 BaseWithIndexAndDisplacement64Matcher match82(graph()->NewNode(a_op, b0, s3)); |
| 1590 CheckBaseWithIndexAndDisplacement(&match82, p1, 3, b0, NULL); |
| 1591 |
| 1592 // (S3 + B0) -> [p1, 2, B0, NULL] |
| 1593 s3 = graph()->NewNode(s_op, p1, d3); |
| 1594 ADD_ADDRESSING_OPERAND_USES(s3); |
| 1595 BaseWithIndexAndDisplacement64Matcher match83(graph()->NewNode(a_op, s3, b0)); |
| 1596 CheckBaseWithIndexAndDisplacement(&match83, p1, 3, b0, NULL); |
| 1597 |
| 1598 // (D15 + S3) -> [p1, 2, NULL, D15] |
| 1599 s3 = graph()->NewNode(s_op, p1, d3); |
| 1600 ADD_ADDRESSING_OPERAND_USES(s3); |
| 1601 BaseWithIndexAndDisplacement64Matcher match84( |
| 1602 graph()->NewNode(a_op, d15, s3)); |
| 1603 CheckBaseWithIndexAndDisplacement(&match84, p1, 3, NULL, d15); |
| 1604 |
| 1605 // (S3 + D15) -> [p1, 2, NULL, D15] |
| 1606 s3 = graph()->NewNode(s_op, p1, d3); |
| 1607 ADD_ADDRESSING_OPERAND_USES(s3); |
| 1608 BaseWithIndexAndDisplacement64Matcher match85( |
| 1609 graph()->NewNode(a_op, s3, d15)); |
| 1610 CheckBaseWithIndexAndDisplacement(&match85, p1, 3, NULL, d15); |
| 1611 |
| 1612 // (D15 + S3) + B0 -> [p1, 2, b0, d15] |
| 1613 s3 = graph()->NewNode(s_op, p1, d3); |
| 1614 temp = graph()->NewNode(a_op, d15, s3); |
| 1615 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1616 BaseWithIndexAndDisplacement64Matcher match86( |
| 1617 graph()->NewNode(a_op, temp, b0)); |
| 1618 CheckBaseWithIndexAndDisplacement(&match86, p1, 3, b0, d15); |
| 1619 |
| 1620 // (B0 + D15) + S3 -> [p1, 2, b0, d15] |
| 1621 s3 = graph()->NewNode(s_op, p1, d3); |
| 1622 temp = graph()->NewNode(a_op, b0, d15); |
| 1623 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1624 BaseWithIndexAndDisplacement64Matcher match87( |
| 1625 graph()->NewNode(a_op, temp, s3)); |
| 1626 CheckBaseWithIndexAndDisplacement(&match87, p1, 3, b0, d15); |
| 1627 |
| 1628 // (S3 + B0) + D15 -> [NULL, 0, (s3 + b0), d15] |
| 1629 // Avoid changing simple addressing to complex addressing |
| 1630 s3 = graph()->NewNode(s_op, p1, d3); |
| 1631 temp = graph()->NewNode(a_op, s3, b0); |
| 1632 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1633 BaseWithIndexAndDisplacement64Matcher match88( |
| 1634 graph()->NewNode(a_op, temp, d15)); |
| 1635 CheckBaseWithIndexAndDisplacement(&match88, NULL, 0, temp, d15); |
| 1636 |
| 1637 // D15 + (S3 + B0) -> [NULL, 0, (s3 + b0), d15] |
| 1638 // Avoid changing simple addressing to complex addressing |
| 1639 s3 = graph()->NewNode(s_op, p1, d3); |
| 1640 temp = graph()->NewNode(a_op, s3, b0); |
| 1641 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1642 BaseWithIndexAndDisplacement64Matcher match89( |
| 1643 graph()->NewNode(a_op, d15, temp)); |
| 1644 CheckBaseWithIndexAndDisplacement(&match89, NULL, 0, temp, d15); |
| 1645 |
| 1646 // B0 + (D15 + S3) -> [p1, 2, b0, d15] |
| 1647 s3 = graph()->NewNode(s_op, p1, d3); |
| 1648 temp = graph()->NewNode(a_op, d15, s3); |
| 1649 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1650 BaseWithIndexAndDisplacement64Matcher match90( |
| 1651 graph()->NewNode(a_op, b0, temp)); |
| 1652 CheckBaseWithIndexAndDisplacement(&match90, p1, 3, b0, d15); |
| 1653 |
| 1654 // S3 + (B0 + D15) -> [p1, 2, b0, d15] |
| 1655 s3 = graph()->NewNode(s_op, p1, d3); |
| 1656 temp = graph()->NewNode(a_op, b0, d15); |
| 1657 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1658 BaseWithIndexAndDisplacement64Matcher match91( |
| 1659 graph()->NewNode(a_op, s3, temp)); |
| 1660 CheckBaseWithIndexAndDisplacement(&match91, p1, 3, b0, d15); |
| 1661 |
| 1662 // S3 + (B0 - D15) -> [p1, 2, b0, d15, true] |
| 1663 s3 = graph()->NewNode(s_op, p1, d3); |
| 1664 temp = graph()->NewNode(sub_op, b0, d15); |
| 1665 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1666 BaseWithIndexAndDisplacement64Matcher match92( |
| 1667 graph()->NewNode(a_op, s3, temp)); |
| 1668 CheckBaseWithIndexAndDisplacement(&match92, p1, 3, b0, d15, |
| 1669 kNegativeDisplacement); |
| 1670 |
| 1671 // B0 + (B1 - D15) -> [p1, 2, b0, d15, true] |
| 1672 temp = graph()->NewNode(sub_op, b1, d15); |
| 1673 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1674 BaseWithIndexAndDisplacement64Matcher match93( |
| 1675 graph()->NewNode(a_op, b0, temp)); |
| 1676 CheckBaseWithIndexAndDisplacement(&match93, b1, 0, b0, d15, |
| 1677 kNegativeDisplacement); |
| 1678 |
| 1679 // (B0 - D15) + S3 -> [p1, 2, b0, d15, true] |
| 1680 s3 = graph()->NewNode(s_op, p1, d3); |
| 1681 temp = graph()->NewNode(sub_op, b0, d15); |
| 1682 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1683 BaseWithIndexAndDisplacement64Matcher match94( |
| 1684 graph()->NewNode(a_op, temp, s3)); |
| 1685 CheckBaseWithIndexAndDisplacement(&match94, p1, 3, b0, d15, |
| 1686 kNegativeDisplacement); |
| 1687 |
| 1688 // (B0 + B1) + D15 -> [NULL, 0, (b0 + b1), d15] |
| 1689 // Avoid changing simple addressing to complex addressing |
| 1690 temp = graph()->NewNode(a_op, b0, b1); |
| 1691 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1692 BaseWithIndexAndDisplacement64Matcher match95( |
| 1693 graph()->NewNode(a_op, temp, d15)); |
| 1694 CheckBaseWithIndexAndDisplacement(&match95, NULL, 0, temp, d15); |
| 1695 |
| 1696 // D15 + (B0 + B1) -> [NULL, 0, (b0 + b1), d15] |
| 1697 // Avoid changing simple addressing to complex addressing |
| 1698 temp = graph()->NewNode(a_op, b0, b1); |
| 1699 ADD_ADDRESSING_OPERAND_USES(temp); |
| 1700 BaseWithIndexAndDisplacement64Matcher match96( |
| 1701 graph()->NewNode(a_op, d15, temp)); |
| 1702 CheckBaseWithIndexAndDisplacement(&match96, NULL, 0, temp, d15); |
| 1703 |
| 1704 // 5 INPUT - with none-addressing operand uses |
| 1705 |
| 1706 // (B0 + M1) -> [b0, 0, m1, NULL] |
| 1707 m1 = graph()->NewNode(m_op, p1, d1); |
| 1708 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 1709 BaseWithIndexAndDisplacement64Matcher match97(graph()->NewNode(a_op, b0, m1)); |
| 1710 CheckBaseWithIndexAndDisplacement(&match97, b0, 0, m1, NULL); |
| 1711 |
| 1712 // (M1 + B0) -> [b0, 0, m1, NULL] |
| 1713 m1 = graph()->NewNode(m_op, p1, d1); |
| 1714 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 1715 BaseWithIndexAndDisplacement64Matcher match98(graph()->NewNode(a_op, m1, b0)); |
| 1716 CheckBaseWithIndexAndDisplacement(&match98, b0, 0, m1, NULL); |
| 1717 |
| 1718 // (D15 + M1) -> [NULL, 0, m1, d15] |
| 1719 m1 = graph()->NewNode(m_op, p1, d1); |
| 1720 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 1721 BaseWithIndexAndDisplacement64Matcher match99( |
| 1722 graph()->NewNode(a_op, d15, m1)); |
| 1723 CheckBaseWithIndexAndDisplacement(&match99, NULL, 0, m1, d15); |
| 1724 |
| 1725 // (M1 + D15) -> [NULL, 0, m1, d15] |
| 1726 m1 = graph()->NewNode(m_op, p1, d1); |
| 1727 ADD_NONE_ADDRESSING_OPERAND_USES(m1); |
| 1728 BaseWithIndexAndDisplacement64Matcher match100( |
| 1729 graph()->NewNode(a_op, m1, d15)); |
| 1730 CheckBaseWithIndexAndDisplacement(&match100, NULL, 0, m1, d15); |
| 1731 |
| 1732 // (B0 + S0) -> [b0, 0, s0, NULL] |
| 1733 s0 = graph()->NewNode(s_op, p1, d0); |
| 1734 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 1735 BaseWithIndexAndDisplacement64Matcher match101( |
| 1736 graph()->NewNode(a_op, b0, s0)); |
| 1737 CheckBaseWithIndexAndDisplacement(&match101, b0, 0, s0, NULL); |
| 1738 |
| 1739 // (S0 + B0) -> [b0, 0, s0, NULL] |
| 1740 s0 = graph()->NewNode(s_op, p1, d0); |
| 1741 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 1742 BaseWithIndexAndDisplacement64Matcher match102( |
| 1743 graph()->NewNode(a_op, s0, b0)); |
| 1744 CheckBaseWithIndexAndDisplacement(&match102, b0, 0, s0, NULL); |
| 1745 |
| 1746 // (D15 + S0) -> [NULL, 0, s0, d15] |
| 1747 s0 = graph()->NewNode(s_op, p1, d0); |
| 1748 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 1749 BaseWithIndexAndDisplacement64Matcher match103( |
| 1750 graph()->NewNode(a_op, d15, s0)); |
| 1751 CheckBaseWithIndexAndDisplacement(&match103, NULL, 0, s0, d15); |
| 1752 |
| 1753 // (S0 + D15) -> [NULL, 0, s0, d15] |
| 1754 s0 = graph()->NewNode(s_op, p1, d0); |
| 1755 ADD_NONE_ADDRESSING_OPERAND_USES(s0); |
| 1756 BaseWithIndexAndDisplacement64Matcher match104( |
| 1757 graph()->NewNode(a_op, s0, d15)); |
| 1758 CheckBaseWithIndexAndDisplacement(&match104, NULL, 0, s0, d15); |
| 1759 |
| 1760 // (B0 + M2) -> [b0, 0, m2, NULL] |
| 1761 m2 = graph()->NewNode(m_op, p1, d2); |
| 1762 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 1763 BaseWithIndexAndDisplacement64Matcher match105( |
| 1764 graph()->NewNode(a_op, b0, m2)); |
| 1765 CheckBaseWithIndexAndDisplacement(&match105, b0, 0, m2, NULL); |
| 1766 |
| 1767 // (M2 + B0) -> [b0, 0, m2, NULL] |
| 1768 m2 = graph()->NewNode(m_op, p1, d2); |
| 1769 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 1770 BaseWithIndexAndDisplacement64Matcher match106( |
| 1771 graph()->NewNode(a_op, m2, b0)); |
| 1772 CheckBaseWithIndexAndDisplacement(&match106, b0, 0, m2, NULL); |
| 1773 |
| 1774 // (D15 + M2) -> [NULL, 0, m2, d15] |
| 1775 m2 = graph()->NewNode(m_op, p1, d2); |
| 1776 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 1777 BaseWithIndexAndDisplacement64Matcher match107( |
| 1778 graph()->NewNode(a_op, d15, m2)); |
| 1779 CheckBaseWithIndexAndDisplacement(&match107, NULL, 0, m2, d15); |
| 1780 |
| 1781 // (M2 + D15) -> [NULL, 0, m2, d15] |
| 1782 m2 = graph()->NewNode(m_op, p1, d2); |
| 1783 ADD_NONE_ADDRESSING_OPERAND_USES(m2); |
| 1784 BaseWithIndexAndDisplacement64Matcher match108( |
| 1785 graph()->NewNode(a_op, m2, d15)); |
| 1786 CheckBaseWithIndexAndDisplacement(&match108, NULL, 0, m2, d15); |
| 1787 |
| 1788 // (B0 + S1) -> [b0, 0, s1, NULL] |
| 1789 s1 = graph()->NewNode(s_op, p1, d1); |
| 1790 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 1791 BaseWithIndexAndDisplacement64Matcher match109( |
| 1792 graph()->NewNode(a_op, b0, s1)); |
| 1793 CheckBaseWithIndexAndDisplacement(&match109, b0, 0, s1, NULL); |
| 1794 |
| 1795 // (S1 + B0) -> [b0, 0, s1, NULL] |
| 1796 s1 = graph()->NewNode(s_op, p1, d1); |
| 1797 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 1798 BaseWithIndexAndDisplacement64Matcher match110( |
| 1799 graph()->NewNode(a_op, s1, b0)); |
| 1800 CheckBaseWithIndexAndDisplacement(&match110, b0, 0, s1, NULL); |
| 1801 |
| 1802 // (D15 + S1) -> [NULL, 0, s1, d15] |
| 1803 s1 = graph()->NewNode(s_op, p1, d1); |
| 1804 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 1805 BaseWithIndexAndDisplacement64Matcher match111( |
| 1806 graph()->NewNode(a_op, d15, s1)); |
| 1807 CheckBaseWithIndexAndDisplacement(&match111, NULL, 0, s1, d15); |
| 1808 |
| 1809 // (S1 + D15) -> [NULL, 0, s1, d15] |
| 1810 s1 = graph()->NewNode(s_op, p1, d1); |
| 1811 ADD_NONE_ADDRESSING_OPERAND_USES(s1); |
| 1812 BaseWithIndexAndDisplacement64Matcher match112( |
| 1813 graph()->NewNode(a_op, s1, d15)); |
| 1814 CheckBaseWithIndexAndDisplacement(&match112, NULL, 0, s1, d15); |
| 1815 |
| 1816 // (B0 + M4) -> [b0, 0, m4, NULL] |
| 1817 m4 = graph()->NewNode(m_op, p1, d4); |
| 1818 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 1819 BaseWithIndexAndDisplacement64Matcher match113( |
| 1820 graph()->NewNode(a_op, b0, m4)); |
| 1821 CheckBaseWithIndexAndDisplacement(&match113, b0, 0, m4, NULL); |
| 1822 |
| 1823 // (M4 + B0) -> [b0, 0, m4, NULL] |
| 1824 m4 = graph()->NewNode(m_op, p1, d4); |
| 1825 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 1826 BaseWithIndexAndDisplacement64Matcher match114( |
| 1827 graph()->NewNode(a_op, m4, b0)); |
| 1828 CheckBaseWithIndexAndDisplacement(&match114, b0, 0, m4, NULL); |
| 1829 |
| 1830 // (D15 + M4) -> [NULL, 0, m4, d15] |
| 1831 m4 = graph()->NewNode(m_op, p1, d4); |
| 1832 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 1833 BaseWithIndexAndDisplacement64Matcher match115( |
| 1834 graph()->NewNode(a_op, d15, m4)); |
| 1835 CheckBaseWithIndexAndDisplacement(&match115, NULL, 0, m4, d15); |
| 1836 |
| 1837 // (M4 + D15) -> [NULL, 0, m4, d15] |
| 1838 m4 = graph()->NewNode(m_op, p1, d4); |
| 1839 ADD_NONE_ADDRESSING_OPERAND_USES(m4); |
| 1840 BaseWithIndexAndDisplacement64Matcher match116( |
| 1841 graph()->NewNode(a_op, m4, d15)); |
| 1842 CheckBaseWithIndexAndDisplacement(&match116, NULL, 0, m4, d15); |
| 1843 |
| 1844 // (B0 + S2) -> [b0, 0, s2, NULL] |
| 1845 s2 = graph()->NewNode(s_op, p1, d2); |
| 1846 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 1847 BaseWithIndexAndDisplacement64Matcher match117( |
| 1848 graph()->NewNode(a_op, b0, s2)); |
| 1849 CheckBaseWithIndexAndDisplacement(&match117, b0, 0, s2, NULL); |
| 1850 |
| 1851 // (S2 + B0) -> [b0, 0, s2, NULL] |
| 1852 s2 = graph()->NewNode(s_op, p1, d2); |
| 1853 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 1854 BaseWithIndexAndDisplacement64Matcher match118( |
| 1855 graph()->NewNode(a_op, s2, b0)); |
| 1856 CheckBaseWithIndexAndDisplacement(&match118, b0, 0, s2, NULL); |
| 1857 |
| 1858 // (D15 + S2) -> [NULL, 0, s2, d15] |
| 1859 s2 = graph()->NewNode(s_op, p1, d2); |
| 1860 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 1861 BaseWithIndexAndDisplacement64Matcher match119( |
| 1862 graph()->NewNode(a_op, d15, s2)); |
| 1863 CheckBaseWithIndexAndDisplacement(&match119, NULL, 0, s2, d15); |
| 1864 |
| 1865 // (S2 + D15) -> [NULL, 0, s2, d15] |
| 1866 s2 = graph()->NewNode(s_op, p1, d2); |
| 1867 ADD_NONE_ADDRESSING_OPERAND_USES(s2); |
| 1868 BaseWithIndexAndDisplacement64Matcher match120( |
| 1869 graph()->NewNode(a_op, s2, d15)); |
| 1870 CheckBaseWithIndexAndDisplacement(&match120, NULL, 0, s2, d15); |
| 1871 |
| 1872 // (B0 + M8) -> [b0, 0, m8, NULL] |
| 1873 m8 = graph()->NewNode(m_op, p1, d8); |
| 1874 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 1875 BaseWithIndexAndDisplacement64Matcher match121( |
| 1876 graph()->NewNode(a_op, b0, m8)); |
| 1877 CheckBaseWithIndexAndDisplacement(&match121, b0, 0, m8, NULL); |
| 1878 |
| 1879 // (M8 + B0) -> [b0, 0, m8, NULL] |
| 1880 m8 = graph()->NewNode(m_op, p1, d8); |
| 1881 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 1882 BaseWithIndexAndDisplacement64Matcher match122( |
| 1883 graph()->NewNode(a_op, m8, b0)); |
| 1884 CheckBaseWithIndexAndDisplacement(&match122, b0, 0, m8, NULL); |
| 1885 |
| 1886 // (D15 + M8) -> [NULL, 0, m8, d15] |
| 1887 m8 = graph()->NewNode(m_op, p1, d8); |
| 1888 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 1889 BaseWithIndexAndDisplacement64Matcher match123( |
| 1890 graph()->NewNode(a_op, d15, m8)); |
| 1891 CheckBaseWithIndexAndDisplacement(&match123, NULL, 0, m8, d15); |
| 1892 |
| 1893 // (M8 + D15) -> [NULL, 0, m8, d15] |
| 1894 m8 = graph()->NewNode(m_op, p1, d8); |
| 1895 ADD_NONE_ADDRESSING_OPERAND_USES(m8); |
| 1896 BaseWithIndexAndDisplacement64Matcher match124( |
| 1897 graph()->NewNode(a_op, m8, d15)); |
| 1898 CheckBaseWithIndexAndDisplacement(&match124, NULL, 0, m8, d15); |
| 1899 |
| 1900 // (B0 + S3) -> [b0, 0, s3, NULL] |
| 1901 s3 = graph()->NewNode(s_op, p1, d3); |
| 1902 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 1903 BaseWithIndexAndDisplacement64Matcher match125( |
| 1904 graph()->NewNode(a_op, b0, s3)); |
| 1905 CheckBaseWithIndexAndDisplacement(&match125, b0, 0, s3, NULL); |
| 1906 |
| 1907 // (S3 + B0) -> [b0, 0, s3, NULL] |
| 1908 s3 = graph()->NewNode(s_op, p1, d3); |
| 1909 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 1910 BaseWithIndexAndDisplacement64Matcher match126( |
| 1911 graph()->NewNode(a_op, s3, b0)); |
| 1912 CheckBaseWithIndexAndDisplacement(&match126, b0, 0, s3, NULL); |
| 1913 |
| 1914 // (D15 + S3) -> [NULL, 0, s3, d15] |
| 1915 s3 = graph()->NewNode(s_op, p1, d3); |
| 1916 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 1917 BaseWithIndexAndDisplacement64Matcher match127( |
| 1918 graph()->NewNode(a_op, d15, s3)); |
| 1919 CheckBaseWithIndexAndDisplacement(&match127, NULL, 0, s3, d15); |
| 1920 |
| 1921 // (S3 + D15) -> [NULL, 0, s3, d15] |
| 1922 s3 = graph()->NewNode(s_op, p1, d3); |
| 1923 ADD_NONE_ADDRESSING_OPERAND_USES(s3); |
| 1924 BaseWithIndexAndDisplacement64Matcher match128( |
| 1925 graph()->NewNode(a_op, s3, d15)); |
| 1926 CheckBaseWithIndexAndDisplacement(&match128, NULL, 0, s3, d15); |
| 1927 |
| 1928 // (D15 + S3) + B0 -> [b0, 0, (D15 + S3), NULL] |
| 1929 s3 = graph()->NewNode(s_op, p1, d3); |
| 1930 temp = graph()->NewNode(a_op, d15, s3); |
| 1931 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1932 BaseWithIndexAndDisplacement64Matcher match129( |
| 1933 graph()->NewNode(a_op, temp, b0)); |
| 1934 CheckBaseWithIndexAndDisplacement(&match129, b0, 0, temp, NULL); |
| 1935 |
| 1936 // (B0 + D15) + S3 -> [p1, 3, (B0 + D15), NULL] |
| 1937 s3 = graph()->NewNode(s_op, p1, d3); |
| 1938 temp = graph()->NewNode(a_op, b0, d15); |
| 1939 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1940 BaseWithIndexAndDisplacement64Matcher match130( |
| 1941 graph()->NewNode(a_op, temp, s3)); |
| 1942 CheckBaseWithIndexAndDisplacement(&match130, p1, 3, temp, NULL); |
| 1943 |
| 1944 // (S3 + B0) + D15 -> [NULL, 0, (S3 + B0), d15] |
| 1945 s3 = graph()->NewNode(s_op, p1, d3); |
| 1946 temp = graph()->NewNode(a_op, s3, b0); |
| 1947 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1948 BaseWithIndexAndDisplacement64Matcher match131( |
| 1949 graph()->NewNode(a_op, temp, d15)); |
| 1950 CheckBaseWithIndexAndDisplacement(&match131, NULL, 0, temp, d15); |
| 1951 |
| 1952 // D15 + (S3 + B0) -> [NULL, 0, (S3 + B0), d15] |
| 1953 s3 = graph()->NewNode(s_op, p1, d3); |
| 1954 temp = graph()->NewNode(a_op, s3, b0); |
| 1955 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1956 BaseWithIndexAndDisplacement64Matcher match132( |
| 1957 graph()->NewNode(a_op, d15, temp)); |
| 1958 CheckBaseWithIndexAndDisplacement(&match132, NULL, 0, temp, d15); |
| 1959 |
| 1960 // B0 + (D15 + S3) -> [b0, 0, (D15 + S3), NULL] |
| 1961 s3 = graph()->NewNode(s_op, p1, d3); |
| 1962 temp = graph()->NewNode(a_op, d15, s3); |
| 1963 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1964 BaseWithIndexAndDisplacement64Matcher match133( |
| 1965 graph()->NewNode(a_op, b0, temp)); |
| 1966 CheckBaseWithIndexAndDisplacement(&match133, b0, 0, temp, NULL); |
| 1967 |
| 1968 // S3 + (B0 + D15) -> [p1, 3, (B0 + D15), NULL] |
| 1969 s3 = graph()->NewNode(s_op, p1, d3); |
| 1970 temp = graph()->NewNode(a_op, b0, d15); |
| 1971 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1972 BaseWithIndexAndDisplacement64Matcher match134( |
| 1973 graph()->NewNode(a_op, s3, temp)); |
| 1974 CheckBaseWithIndexAndDisplacement(&match134, p1, 3, temp, NULL); |
| 1975 |
| 1976 // S3 + (B0 - D15) -> [p1, 3, (B0 - D15), NULL] |
| 1977 s3 = graph()->NewNode(s_op, p1, d3); |
| 1978 temp = graph()->NewNode(sub_op, b0, d15); |
| 1979 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1980 BaseWithIndexAndDisplacement64Matcher match135( |
| 1981 graph()->NewNode(a_op, s3, temp)); |
| 1982 CheckBaseWithIndexAndDisplacement(&match135, p1, 3, temp, NULL); |
| 1983 |
| 1984 // B0 + (B1 - D15) -> [b0, 0, (B1 - D15), NULL] |
| 1985 temp = graph()->NewNode(sub_op, b1, d15); |
| 1986 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1987 BaseWithIndexAndDisplacement64Matcher match136( |
| 1988 graph()->NewNode(a_op, b0, temp)); |
| 1989 CheckBaseWithIndexAndDisplacement(&match136, b0, 0, temp, NULL); |
| 1990 |
| 1991 // (B0 - D15) + S3 -> [p1, 3, temp, NULL] |
| 1992 s3 = graph()->NewNode(s_op, p1, d3); |
| 1993 temp = graph()->NewNode(sub_op, b0, d15); |
| 1994 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 1995 BaseWithIndexAndDisplacement64Matcher match137( |
| 1996 graph()->NewNode(a_op, temp, s3)); |
| 1997 CheckBaseWithIndexAndDisplacement(&match137, p1, 3, temp, NULL); |
| 1998 |
| 1999 // (B0 + B1) + D15 -> [NULL, 0, (B0 + B1), d15] |
| 2000 temp = graph()->NewNode(a_op, b0, b1); |
| 2001 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 2002 BaseWithIndexAndDisplacement64Matcher match138( |
| 2003 graph()->NewNode(a_op, temp, d15)); |
| 2004 CheckBaseWithIndexAndDisplacement(&match138, NULL, 0, temp, d15); |
| 2005 |
| 2006 // D15 + (B0 + B1) -> [NULL, 0, (B0 + B1), d15] |
| 2007 temp = graph()->NewNode(a_op, b0, b1); |
| 2008 ADD_NONE_ADDRESSING_OPERAND_USES(temp); |
| 2009 BaseWithIndexAndDisplacement64Matcher match139( |
| 2010 graph()->NewNode(a_op, d15, temp)); |
| 2011 CheckBaseWithIndexAndDisplacement(&match139, NULL, 0, temp, d15); |
775 } | 2012 } |
776 | 2013 |
777 TEST_F(NodeMatcherTest, BranchMatcher_match) { | 2014 TEST_F(NodeMatcherTest, BranchMatcher_match) { |
778 Node* zero = graph()->NewNode(common()->Int32Constant(0)); | 2015 Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
779 | 2016 |
780 { | 2017 { |
781 Node* branch = graph()->NewNode(common()->Branch(), zero, graph()->start()); | 2018 Node* branch = graph()->NewNode(common()->Branch(), zero, graph()->start()); |
782 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 2019 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
783 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); | 2020 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); |
784 BranchMatcher matcher(branch); | 2021 BranchMatcher matcher(branch); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); | 2225 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); |
989 DiamondMatcher matcher(merge); | 2226 DiamondMatcher matcher(merge); |
990 EXPECT_FALSE(matcher.Matched()); | 2227 EXPECT_FALSE(matcher.Matched()); |
991 } | 2228 } |
992 } | 2229 } |
993 | 2230 |
994 | 2231 |
995 } // namespace compiler | 2232 } // namespace compiler |
996 } // namespace internal | 2233 } // namespace internal |
997 } // namespace v8 | 2234 } // namespace v8 |
OLD | NEW |