| 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 <limits> | 5 #include <limits> | 
| 6 | 6 | 
| 7 #include "test/unittests/compiler/instruction-selector-unittest.h" | 7 #include "test/unittests/compiler/instruction-selector-unittest.h" | 
| 8 | 8 | 
| 9 namespace v8 { | 9 namespace v8 { | 
| 10 namespace internal { | 10 namespace internal { | 
| (...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1758   ASSERT_EQ(1U, s.size()); | 1758   ASSERT_EQ(1U, s.size()); | 
| 1759   EXPECT_EQ(kArmSmmul, s[0]->arch_opcode()); | 1759   EXPECT_EQ(kArmSmmul, s[0]->arch_opcode()); | 
| 1760   ASSERT_EQ(2U, s[0]->InputCount()); | 1760   ASSERT_EQ(2U, s[0]->InputCount()); | 
| 1761   EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 1761   EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 
| 1762   EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); | 1762   EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); | 
| 1763   ASSERT_EQ(1U, s[0]->OutputCount()); | 1763   ASSERT_EQ(1U, s[0]->OutputCount()); | 
| 1764   EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 1764   EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 
| 1765 } | 1765 } | 
| 1766 | 1766 | 
| 1767 | 1767 | 
|  | 1768 TEST_F(InstructionSelectorTest, Uint32MulHighWithParameters) { | 
|  | 1769   StreamBuilder m(this, kMachUint32, kMachUint32, kMachUint32); | 
|  | 1770   Node* const p0 = m.Parameter(0); | 
|  | 1771   Node* const p1 = m.Parameter(1); | 
|  | 1772   Node* const n = m.Uint32MulHigh(p0, p1); | 
|  | 1773   m.Return(n); | 
|  | 1774   Stream s = m.Build(); | 
|  | 1775   ASSERT_EQ(1U, s.size()); | 
|  | 1776   EXPECT_EQ(kArmUmull, s[0]->arch_opcode()); | 
|  | 1777   ASSERT_EQ(2U, s[0]->InputCount()); | 
|  | 1778   EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 
|  | 1779   EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); | 
|  | 1780   ASSERT_EQ(2U, s[0]->OutputCount()); | 
|  | 1781   EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->OutputAt(1))); | 
|  | 1782 } | 
|  | 1783 | 
|  | 1784 | 
| 1768 TEST_F(InstructionSelectorTest, Uint32DivWithParameters) { | 1785 TEST_F(InstructionSelectorTest, Uint32DivWithParameters) { | 
| 1769   StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32); | 1786   StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32); | 
| 1770   m.Return(m.Uint32Div(m.Parameter(0), m.Parameter(1))); | 1787   m.Return(m.Uint32Div(m.Parameter(0), m.Parameter(1))); | 
| 1771   Stream s = m.Build(); | 1788   Stream s = m.Build(); | 
| 1772   ASSERT_EQ(4U, s.size()); | 1789   ASSERT_EQ(4U, s.size()); | 
| 1773   EXPECT_EQ(kArmVcvtF64U32, s[0]->arch_opcode()); | 1790   EXPECT_EQ(kArmVcvtF64U32, s[0]->arch_opcode()); | 
| 1774   ASSERT_EQ(1U, s[0]->OutputCount()); | 1791   ASSERT_EQ(1U, s[0]->OutputCount()); | 
| 1775   EXPECT_EQ(kArmVcvtF64U32, s[1]->arch_opcode()); | 1792   EXPECT_EQ(kArmVcvtF64U32, s[1]->arch_opcode()); | 
| 1776   ASSERT_EQ(1U, s[1]->OutputCount()); | 1793   ASSERT_EQ(1U, s[1]->OutputCount()); | 
| 1777   EXPECT_EQ(kArmVdivF64, s[2]->arch_opcode()); | 1794   EXPECT_EQ(kArmVdivF64, s[2]->arch_opcode()); | 
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2101       ASSERT_EQ(3U, s[0]->InputCount()); | 2118       ASSERT_EQ(3U, s[0]->InputCount()); | 
| 2102       EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); | 2119       EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); | 
| 2103       EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); | 2120       EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); | 
| 2104     } | 2121     } | 
| 2105   } | 2122   } | 
| 2106 } | 2123 } | 
| 2107 | 2124 | 
| 2108 }  // namespace compiler | 2125 }  // namespace compiler | 
| 2109 }  // namespace internal | 2126 }  // namespace internal | 
| 2110 }  // namespace v8 | 2127 }  // namespace v8 | 
| OLD | NEW | 
|---|