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 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 ASSERT_EQ(1U, s.size()); | 793 ASSERT_EQ(1U, s.size()); |
794 EXPECT_EQ(kMipsCmp, s[0]->arch_opcode()); | 794 EXPECT_EQ(kMipsCmp, s[0]->arch_opcode()); |
795 EXPECT_EQ(kMode_None, s[0]->addressing_mode()); | 795 EXPECT_EQ(kMode_None, s[0]->addressing_mode()); |
796 ASSERT_EQ(2U, s[0]->InputCount()); | 796 ASSERT_EQ(2U, s[0]->InputCount()); |
797 EXPECT_EQ(1U, s[0]->OutputCount()); | 797 EXPECT_EQ(1U, s[0]->OutputCount()); |
798 EXPECT_EQ(kFlags_set, s[0]->flags_mode()); | 798 EXPECT_EQ(kFlags_set, s[0]->flags_mode()); |
799 EXPECT_EQ(kEqual, s[0]->flags_condition()); | 799 EXPECT_EQ(kEqual, s[0]->flags_condition()); |
800 } | 800 } |
801 } | 801 } |
802 | 802 |
| 803 |
| 804 TEST_F(InstructionSelectorTest, Word32Clz) { |
| 805 StreamBuilder m(this, kMachUint32, kMachUint32); |
| 806 Node* const p0 = m.Parameter(0); |
| 807 Node* const n = m.Word32Clz(p0); |
| 808 m.Return(n); |
| 809 Stream s = m.Build(); |
| 810 ASSERT_EQ(1U, s.size()); |
| 811 EXPECT_EQ(kMipsClz, s[0]->arch_opcode()); |
| 812 ASSERT_EQ(1U, s[0]->InputCount()); |
| 813 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 814 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 815 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 816 } |
| 817 |
803 } // namespace compiler | 818 } // namespace compiler |
804 } // namespace internal | 819 } // namespace internal |
805 } // namespace v8 | 820 } // namespace v8 |
OLD | NEW |