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

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

Issue 1021183002: [turbofan] Turn Math.clz32 into an inlinable builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 Stream s = m.Build(); 1139 Stream s = m.Build();
1140 ASSERT_EQ(1U, s.size()); 1140 ASSERT_EQ(1U, s.size());
1141 EXPECT_EQ(kX64Movzxwl, s[0]->arch_opcode()); 1141 EXPECT_EQ(kX64Movzxwl, s[0]->arch_opcode());
1142 ASSERT_EQ(1U, s[0]->InputCount()); 1142 ASSERT_EQ(1U, s[0]->InputCount());
1143 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); 1143 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
1144 ASSERT_EQ(1U, s[0]->OutputCount()); 1144 ASSERT_EQ(1U, s[0]->OutputCount());
1145 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); 1145 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
1146 } 1146 }
1147 } 1147 }
1148 1148
1149
1150 TEST_F(InstructionSelectorTest, Word32Clz) {
1151 StreamBuilder m(this, kMachUint32, kMachUint32);
1152 Node* const p0 = m.Parameter(0);
1153 Node* const n = m.Word32Clz(p0);
1154 m.Return(n);
1155 Stream s = m.Build();
1156 ASSERT_EQ(1U, s.size());
1157 EXPECT_EQ(kX64Lzcnt32, s[0]->arch_opcode());
1158 ASSERT_EQ(1U, s[0]->InputCount());
1159 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
1160 ASSERT_EQ(1U, s[0]->OutputCount());
1161 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
1162 }
1163
1149 } // namespace compiler 1164 } // namespace compiler
1150 } // namespace internal 1165 } // namespace internal
1151 } // namespace v8 1166 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698