Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc

Issue 654833002: [turbofan] Optimize division/modulus by constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 Stream s = m.Build(); 1752 Stream s = m.Build();
1753 ASSERT_EQ(1U, s.size()); 1753 ASSERT_EQ(1U, s.size());
1754 EXPECT_EQ(kArm64Ubfx, s[0]->arch_opcode()); 1754 EXPECT_EQ(kArm64Ubfx, s[0]->arch_opcode());
1755 ASSERT_EQ(3U, s[0]->InputCount()); 1755 ASSERT_EQ(3U, s[0]->InputCount());
1756 EXPECT_EQ(lsb, s.ToInt64(s[0]->InputAt(1))); 1756 EXPECT_EQ(lsb, s.ToInt64(s[0]->InputAt(1)));
1757 EXPECT_EQ(width, s.ToInt64(s[0]->InputAt(2))); 1757 EXPECT_EQ(width, s.ToInt64(s[0]->InputAt(2)));
1758 } 1758 }
1759 } 1759 }
1760 } 1760 }
1761 1761
1762
1763 TEST_F(InstructionSelectorTest, Int32MulHighWithParameters) {
1764 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32);
1765 Node* const p0 = m.Parameter(0);
1766 Node* const p1 = m.Parameter(1);
1767 Node* const n = m.Int32MulHigh(p0, p1);
1768 m.Return(n);
1769 Stream s = m.Build();
1770 ASSERT_EQ(2U, s.size());
1771 EXPECT_EQ(kArm64Smull, s[0]->arch_opcode());
1772 ASSERT_EQ(2U, s[0]->InputCount());
1773 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
1774 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1)));
1775 ASSERT_EQ(1U, s[0]->OutputCount());
1776 EXPECT_EQ(kArm64Asr, s[1]->arch_opcode());
1777 ASSERT_EQ(2U, s[1]->InputCount());
1778 EXPECT_EQ(s.ToVreg(s[0]->Output()), s.ToVreg(s[1]->InputAt(0)));
1779 EXPECT_EQ(32, s.ToInt64(s[1]->InputAt(1)));
1780 ASSERT_EQ(1U, s[1]->OutputCount());
1781 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[1]->Output()));
1782 }
1783
1762 } // namespace compiler 1784 } // namespace compiler
1763 } // namespace internal 1785 } // namespace internal
1764 } // namespace v8 1786 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/arm/instruction-selector-arm-unittest.cc ('k') | test/unittests/compiler/graph-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698