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 "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 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 Stream s = m.Build(); | 2235 Stream s = m.Build(); |
2236 ASSERT_EQ(1U, s.size()); | 2236 ASSERT_EQ(1U, s.size()); |
2237 EXPECT_EQ(kArm64Sxth32, s[0]->arch_opcode()); | 2237 EXPECT_EQ(kArm64Sxth32, s[0]->arch_opcode()); |
2238 ASSERT_EQ(1U, s[0]->InputCount()); | 2238 ASSERT_EQ(1U, s[0]->InputCount()); |
2239 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 2239 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
2240 ASSERT_EQ(1U, s[0]->OutputCount()); | 2240 ASSERT_EQ(1U, s[0]->OutputCount()); |
2241 EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output())); | 2241 EXPECT_EQ(s.ToVreg(r), s.ToVreg(s[0]->Output())); |
2242 } | 2242 } |
2243 } | 2243 } |
2244 | 2244 |
| 2245 |
| 2246 TEST_F(InstructionSelectorTest, Word32Clz) { |
| 2247 StreamBuilder m(this, kMachUint32, kMachUint32); |
| 2248 Node* const p0 = m.Parameter(0); |
| 2249 Node* const n = m.Word32Clz(p0); |
| 2250 m.Return(n); |
| 2251 Stream s = m.Build(); |
| 2252 ASSERT_EQ(1U, s.size()); |
| 2253 EXPECT_EQ(kArm64Clz32, s[0]->arch_opcode()); |
| 2254 ASSERT_EQ(1U, s[0]->InputCount()); |
| 2255 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 2256 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 2257 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 2258 } |
| 2259 |
2245 } // namespace compiler | 2260 } // namespace compiler |
2246 } // namespace internal | 2261 } // namespace internal |
2247 } // namespace v8 | 2262 } // namespace v8 |
OLD | NEW |