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 "test/unittests/compiler/instruction-selector-unittest.h" | 5 #include "test/unittests/compiler/instruction-selector-unittest.h" |
6 | 6 |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32); | 503 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32); |
504 Node* const p0 = m.Parameter(0); | 504 Node* const p0 = m.Parameter(0); |
505 Node* const p1 = m.Parameter(1); | 505 Node* const p1 = m.Parameter(1); |
506 Node* const n = m.Int32MulHigh(p0, p1); | 506 Node* const n = m.Int32MulHigh(p0, p1); |
507 m.Return(n); | 507 m.Return(n); |
508 Stream s = m.Build(); | 508 Stream s = m.Build(); |
509 ASSERT_EQ(1U, s.size()); | 509 ASSERT_EQ(1U, s.size()); |
510 EXPECT_EQ(kX64ImulHigh32, s[0]->arch_opcode()); | 510 EXPECT_EQ(kX64ImulHigh32, s[0]->arch_opcode()); |
511 ASSERT_EQ(2U, s[0]->InputCount()); | 511 ASSERT_EQ(2U, s[0]->InputCount()); |
512 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 512 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 513 EXPECT_TRUE(s.IsFixed(s[0]->InputAt(0), rax)); |
513 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); | 514 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); |
| 515 EXPECT_TRUE(!s.IsUsedAtStart(s[0]->InputAt(1))); |
514 ASSERT_EQ(1U, s[0]->OutputCount()); | 516 ASSERT_EQ(1U, s[0]->OutputCount()); |
515 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 517 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 518 EXPECT_TRUE(s.IsFixed(s[0]->OutputAt(0), rdx)); |
516 } | 519 } |
517 | 520 |
518 } // namespace compiler | 521 } // namespace compiler |
519 } // namespace internal | 522 } // namespace internal |
520 } // namespace v8 | 523 } // namespace v8 |
OLD | NEW |