| 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 Stream s = m.Build(); | 834 Stream s = m.Build(); |
| 835 ASSERT_EQ(1U, s.size()); | 835 ASSERT_EQ(1U, s.size()); |
| 836 EXPECT_EQ(kMips64Clz, s[0]->arch_opcode()); | 836 EXPECT_EQ(kMips64Clz, s[0]->arch_opcode()); |
| 837 ASSERT_EQ(1U, s[0]->InputCount()); | 837 ASSERT_EQ(1U, s[0]->InputCount()); |
| 838 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 838 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 839 ASSERT_EQ(1U, s[0]->OutputCount()); | 839 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 840 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 840 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 841 } | 841 } |
| 842 | 842 |
| 843 | 843 |
| 844 TEST_F(InstructionSelectorTest, Word64Clz) { |
| 845 StreamBuilder m(this, kMachUint64, kMachUint64); |
| 846 Node* const p0 = m.Parameter(0); |
| 847 Node* const n = m.Word64Clz(p0); |
| 848 m.Return(n); |
| 849 Stream s = m.Build(); |
| 850 ASSERT_EQ(1U, s.size()); |
| 851 EXPECT_EQ(kMips64Dclz, s[0]->arch_opcode()); |
| 852 ASSERT_EQ(1U, s[0]->InputCount()); |
| 853 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 854 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 855 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 856 } |
| 857 |
| 858 |
| 844 TEST_F(InstructionSelectorTest, Float32Abs) { | 859 TEST_F(InstructionSelectorTest, Float32Abs) { |
| 845 StreamBuilder m(this, kMachFloat32, kMachFloat32); | 860 StreamBuilder m(this, kMachFloat32, kMachFloat32); |
| 846 Node* const p0 = m.Parameter(0); | 861 Node* const p0 = m.Parameter(0); |
| 847 Node* const n = m.Float32Abs(p0); | 862 Node* const n = m.Float32Abs(p0); |
| 848 m.Return(n); | 863 m.Return(n); |
| 849 Stream s = m.Build(); | 864 Stream s = m.Build(); |
| 850 ASSERT_EQ(1U, s.size()); | 865 ASSERT_EQ(1U, s.size()); |
| 851 EXPECT_EQ(kMips64AbsS, s[0]->arch_opcode()); | 866 EXPECT_EQ(kMips64AbsS, s[0]->arch_opcode()); |
| 852 ASSERT_EQ(1U, s[0]->InputCount()); | 867 ASSERT_EQ(1U, s[0]->InputCount()); |
| 853 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 868 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 ASSERT_EQ(1U, s.size()); | 945 ASSERT_EQ(1U, s.size()); |
| 931 EXPECT_EQ(kMips64Float64Min, s[0]->arch_opcode()); | 946 EXPECT_EQ(kMips64Float64Min, s[0]->arch_opcode()); |
| 932 ASSERT_EQ(2U, s[0]->InputCount()); | 947 ASSERT_EQ(2U, s[0]->InputCount()); |
| 933 ASSERT_EQ(1U, s[0]->OutputCount()); | 948 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 934 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 949 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 935 } | 950 } |
| 936 | 951 |
| 937 } // namespace compiler | 952 } // namespace compiler |
| 938 } // namespace internal | 953 } // namespace internal |
| 939 } // namespace v8 | 954 } // namespace v8 |
| OLD | NEW |