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

Side by Side Diff: test/unittests/compiler/arm/instruction-selector-arm-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
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 <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 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 Stream s = m.Build(ARMv7); 2419 Stream s = m.Build(ARMv7);
2420 ASSERT_EQ(1U, s.size()); 2420 ASSERT_EQ(1U, s.size());
2421 EXPECT_EQ(kArmUbfx, s[0]->arch_opcode()); 2421 EXPECT_EQ(kArmUbfx, s[0]->arch_opcode());
2422 ASSERT_EQ(3U, s[0]->InputCount()); 2422 ASSERT_EQ(3U, s[0]->InputCount());
2423 EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); 2423 EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1)));
2424 EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); 2424 EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2)));
2425 } 2425 }
2426 } 2426 }
2427 } 2427 }
2428 2428
2429
2430 TEST_F(InstructionSelectorTest, Word32Clz) {
2431 StreamBuilder m(this, kMachUint32, kMachUint32);
2432 Node* const p0 = m.Parameter(0);
2433 Node* const n = m.Word32Clz(p0);
2434 m.Return(n);
2435 Stream s = m.Build();
2436 ASSERT_EQ(1U, s.size());
2437 EXPECT_EQ(kArmClz, s[0]->arch_opcode());
2438 ASSERT_EQ(1U, s[0]->InputCount());
2439 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
2440 ASSERT_EQ(1U, s[0]->OutputCount());
2441 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
2442 }
2443
2429 } // namespace compiler 2444 } // namespace compiler
2430 } // namespace internal 2445 } // namespace internal
2431 } // namespace v8 2446 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/asm/math-clz32.js ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698