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 #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 Loading... |
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 |
OLD | NEW |