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 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |