OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/test-utils.h" | 5 #include "test/unittests/test-utils.h" |
6 | 6 |
7 #include "src/wasm/wasm-macro-gen.h" | 7 #include "src/wasm/wasm-macro-gen.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 EXPECT_SIZE(5, WASM_I32_LEU(WASM_ZERO, WASM_ZERO)); | 178 EXPECT_SIZE(5, WASM_I32_LEU(WASM_ZERO, WASM_ZERO)); |
179 | 179 |
180 EXPECT_SIZE(5, WASM_I32_GTS(WASM_ZERO, WASM_ZERO)); | 180 EXPECT_SIZE(5, WASM_I32_GTS(WASM_ZERO, WASM_ZERO)); |
181 EXPECT_SIZE(5, WASM_I32_GES(WASM_ZERO, WASM_ZERO)); | 181 EXPECT_SIZE(5, WASM_I32_GES(WASM_ZERO, WASM_ZERO)); |
182 EXPECT_SIZE(5, WASM_I32_GTU(WASM_ZERO, WASM_ZERO)); | 182 EXPECT_SIZE(5, WASM_I32_GTU(WASM_ZERO, WASM_ZERO)); |
183 EXPECT_SIZE(5, WASM_I32_GEU(WASM_ZERO, WASM_ZERO)); | 183 EXPECT_SIZE(5, WASM_I32_GEU(WASM_ZERO, WASM_ZERO)); |
184 | 184 |
185 EXPECT_SIZE(3, WASM_I32_CLZ(WASM_ZERO)); | 185 EXPECT_SIZE(3, WASM_I32_CLZ(WASM_ZERO)); |
186 EXPECT_SIZE(3, WASM_I32_CTZ(WASM_ZERO)); | 186 EXPECT_SIZE(3, WASM_I32_CTZ(WASM_ZERO)); |
187 EXPECT_SIZE(3, WASM_I32_POPCNT(WASM_ZERO)); | 187 EXPECT_SIZE(3, WASM_I32_POPCNT(WASM_ZERO)); |
| 188 |
| 189 EXPECT_SIZE(3, WASM_I32_EQZ(WASM_ZERO)); |
188 } | 190 } |
189 | 191 |
190 | 192 |
191 TEST_F(WasmMacroGenTest, Int64Ops) { | 193 TEST_F(WasmMacroGenTest, Int64Ops) { |
192 EXPECT_SIZE(5, WASM_I64_ADD(WASM_ZERO, WASM_ZERO)); | 194 EXPECT_SIZE(5, WASM_I64_ADD(WASM_ZERO, WASM_ZERO)); |
193 EXPECT_SIZE(5, WASM_I64_SUB(WASM_ZERO, WASM_ZERO)); | 195 EXPECT_SIZE(5, WASM_I64_SUB(WASM_ZERO, WASM_ZERO)); |
194 EXPECT_SIZE(5, WASM_I64_MUL(WASM_ZERO, WASM_ZERO)); | 196 EXPECT_SIZE(5, WASM_I64_MUL(WASM_ZERO, WASM_ZERO)); |
195 EXPECT_SIZE(5, WASM_I64_DIVS(WASM_ZERO, WASM_ZERO)); | 197 EXPECT_SIZE(5, WASM_I64_DIVS(WASM_ZERO, WASM_ZERO)); |
196 EXPECT_SIZE(5, WASM_I64_DIVU(WASM_ZERO, WASM_ZERO)); | 198 EXPECT_SIZE(5, WASM_I64_DIVU(WASM_ZERO, WASM_ZERO)); |
197 EXPECT_SIZE(5, WASM_I64_REMS(WASM_ZERO, WASM_ZERO)); | 199 EXPECT_SIZE(5, WASM_I64_REMS(WASM_ZERO, WASM_ZERO)); |
(...skipping 14 matching lines...) Expand all Loading... |
212 EXPECT_SIZE(5, WASM_I64_LEU(WASM_ZERO, WASM_ZERO)); | 214 EXPECT_SIZE(5, WASM_I64_LEU(WASM_ZERO, WASM_ZERO)); |
213 | 215 |
214 EXPECT_SIZE(5, WASM_I64_GTS(WASM_ZERO, WASM_ZERO)); | 216 EXPECT_SIZE(5, WASM_I64_GTS(WASM_ZERO, WASM_ZERO)); |
215 EXPECT_SIZE(5, WASM_I64_GES(WASM_ZERO, WASM_ZERO)); | 217 EXPECT_SIZE(5, WASM_I64_GES(WASM_ZERO, WASM_ZERO)); |
216 EXPECT_SIZE(5, WASM_I64_GTU(WASM_ZERO, WASM_ZERO)); | 218 EXPECT_SIZE(5, WASM_I64_GTU(WASM_ZERO, WASM_ZERO)); |
217 EXPECT_SIZE(5, WASM_I64_GEU(WASM_ZERO, WASM_ZERO)); | 219 EXPECT_SIZE(5, WASM_I64_GEU(WASM_ZERO, WASM_ZERO)); |
218 | 220 |
219 EXPECT_SIZE(3, WASM_I64_CLZ(WASM_ZERO)); | 221 EXPECT_SIZE(3, WASM_I64_CLZ(WASM_ZERO)); |
220 EXPECT_SIZE(3, WASM_I64_CTZ(WASM_ZERO)); | 222 EXPECT_SIZE(3, WASM_I64_CTZ(WASM_ZERO)); |
221 EXPECT_SIZE(3, WASM_I64_POPCNT(WASM_ZERO)); | 223 EXPECT_SIZE(3, WASM_I64_POPCNT(WASM_ZERO)); |
| 224 |
| 225 EXPECT_SIZE(3, WASM_I64_EQZ(WASM_ZERO)); |
222 } | 226 } |
223 | 227 |
224 | 228 |
225 TEST_F(WasmMacroGenTest, Float32Ops) { | 229 TEST_F(WasmMacroGenTest, Float32Ops) { |
226 EXPECT_SIZE(5, WASM_F32_ADD(WASM_ZERO, WASM_ZERO)); | 230 EXPECT_SIZE(5, WASM_F32_ADD(WASM_ZERO, WASM_ZERO)); |
227 EXPECT_SIZE(5, WASM_F32_SUB(WASM_ZERO, WASM_ZERO)); | 231 EXPECT_SIZE(5, WASM_F32_SUB(WASM_ZERO, WASM_ZERO)); |
228 EXPECT_SIZE(5, WASM_F32_MUL(WASM_ZERO, WASM_ZERO)); | 232 EXPECT_SIZE(5, WASM_F32_MUL(WASM_ZERO, WASM_ZERO)); |
229 EXPECT_SIZE(5, WASM_F32_DIV(WASM_ZERO, WASM_ZERO)); | 233 EXPECT_SIZE(5, WASM_F32_DIV(WASM_ZERO, WASM_ZERO)); |
230 EXPECT_SIZE(5, WASM_F32_MIN(WASM_ZERO, WASM_ZERO)); | 234 EXPECT_SIZE(5, WASM_F32_MIN(WASM_ZERO, WASM_ZERO)); |
231 EXPECT_SIZE(5, WASM_F32_MAX(WASM_ZERO, WASM_ZERO)); | 235 EXPECT_SIZE(5, WASM_F32_MAX(WASM_ZERO, WASM_ZERO)); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO)); | 323 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO)); |
320 } | 324 } |
321 for (size_t i = 0; i < arraysize(kMemTypes); i++) { | 325 for (size_t i = 0; i < arraysize(kMemTypes); i++) { |
322 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO, | 326 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO, |
323 WASM_GET_LOCAL(0))); | 327 WASM_GET_LOCAL(0))); |
324 } | 328 } |
325 } | 329 } |
326 } // namespace wasm | 330 } // namespace wasm |
327 } // namespace internal | 331 } // namespace internal |
328 } // namespace v8 | 332 } // namespace v8 |
OLD | NEW |