1 // Copyright 2019 Google LLC
2 //
3 // This source code is licensed under the BSD-style license found in the
4 // LICENSE file in the root directory of this source tree.
5
6 #include <gtest/gtest.h>
7
8 #include <xnnpack/common.h>
9 #include <xnnpack/isa-checks.h>
10
11 #include <xnnpack/zip.h>
12 #include "zip-microkernel-tester.h"
13
14
15 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(X32_ZIP_X2__NEON,n_eq_4)16 TEST(X32_ZIP_X2__NEON, n_eq_4) {
17 TEST_REQUIRES_ARM_NEON;
18 ZipMicrokernelTester()
19 .n(4)
20 .g(2)
21 .Test(xnn_x32_zip_x2_ukernel__neon);
22 }
23
TEST(X32_ZIP_X2__NEON,n_div_4)24 TEST(X32_ZIP_X2__NEON, n_div_4) {
25 TEST_REQUIRES_ARM_NEON;
26 for (size_t n = 4; n < 64; n += 4) {
27 ZipMicrokernelTester()
28 .n(n)
29 .g(2)
30 .Test(xnn_x32_zip_x2_ukernel__neon);
31 }
32 }
33
TEST(X32_ZIP_X2__NEON,n_gt_4)34 TEST(X32_ZIP_X2__NEON, n_gt_4) {
35 TEST_REQUIRES_ARM_NEON;
36 for (size_t n = 5; n < 8; n++) {
37 ZipMicrokernelTester()
38 .n(n)
39 .g(2)
40 .Test(xnn_x32_zip_x2_ukernel__neon);
41 }
42 }
43
TEST(X32_ZIP_X2__NEON,n_lt_4)44 TEST(X32_ZIP_X2__NEON, n_lt_4) {
45 TEST_REQUIRES_ARM_NEON;
46 for (size_t n = 1; n < 4; n++) {
47 ZipMicrokernelTester()
48 .n(n)
49 .g(2)
50 .Test(xnn_x32_zip_x2_ukernel__neon);
51 }
52 }
53
TEST(X32_ZIP_X3__NEON,n_eq_4)54 TEST(X32_ZIP_X3__NEON, n_eq_4) {
55 TEST_REQUIRES_ARM_NEON;
56 ZipMicrokernelTester()
57 .n(4)
58 .g(3)
59 .Test(xnn_x32_zip_x3_ukernel__neon);
60 }
61
TEST(X32_ZIP_X3__NEON,n_div_4)62 TEST(X32_ZIP_X3__NEON, n_div_4) {
63 TEST_REQUIRES_ARM_NEON;
64 for (size_t n = 4; n < 64; n += 4) {
65 ZipMicrokernelTester()
66 .n(n)
67 .g(3)
68 .Test(xnn_x32_zip_x3_ukernel__neon);
69 }
70 }
71
TEST(X32_ZIP_X3__NEON,n_gt_4)72 TEST(X32_ZIP_X3__NEON, n_gt_4) {
73 TEST_REQUIRES_ARM_NEON;
74 for (size_t n = 5; n < 8; n++) {
75 ZipMicrokernelTester()
76 .n(n)
77 .g(3)
78 .Test(xnn_x32_zip_x3_ukernel__neon);
79 }
80 }
81
TEST(X32_ZIP_X3__NEON,n_lt_4)82 TEST(X32_ZIP_X3__NEON, n_lt_4) {
83 TEST_REQUIRES_ARM_NEON;
84 for (size_t n = 1; n < 4; n++) {
85 ZipMicrokernelTester()
86 .n(n)
87 .g(3)
88 .Test(xnn_x32_zip_x3_ukernel__neon);
89 }
90 }
91
TEST(X32_ZIP_X4__NEON,n_eq_4)92 TEST(X32_ZIP_X4__NEON, n_eq_4) {
93 TEST_REQUIRES_ARM_NEON;
94 ZipMicrokernelTester()
95 .n(4)
96 .g(4)
97 .Test(xnn_x32_zip_x4_ukernel__neon);
98 }
99
TEST(X32_ZIP_X4__NEON,n_div_4)100 TEST(X32_ZIP_X4__NEON, n_div_4) {
101 TEST_REQUIRES_ARM_NEON;
102 for (size_t n = 4; n < 64; n += 4) {
103 ZipMicrokernelTester()
104 .n(n)
105 .g(4)
106 .Test(xnn_x32_zip_x4_ukernel__neon);
107 }
108 }
109
TEST(X32_ZIP_X4__NEON,n_gt_4)110 TEST(X32_ZIP_X4__NEON, n_gt_4) {
111 TEST_REQUIRES_ARM_NEON;
112 for (size_t n = 5; n < 8; n++) {
113 ZipMicrokernelTester()
114 .n(n)
115 .g(4)
116 .Test(xnn_x32_zip_x4_ukernel__neon);
117 }
118 }
119
TEST(X32_ZIP_X4__NEON,n_lt_4)120 TEST(X32_ZIP_X4__NEON, n_lt_4) {
121 TEST_REQUIRES_ARM_NEON;
122 for (size_t n = 1; n < 4; n++) {
123 ZipMicrokernelTester()
124 .n(n)
125 .g(4)
126 .Test(xnn_x32_zip_x4_ukernel__neon);
127 }
128 }
129
TEST(X32_ZIP_XM__NEON,n_eq_4_m_eq_4)130 TEST(X32_ZIP_XM__NEON, n_eq_4_m_eq_4) {
131 TEST_REQUIRES_ARM_NEON;
132 ZipMicrokernelTester()
133 .n(4)
134 .g(4)
135 .Test(xnn_x32_zip_xm_ukernel__neon);
136 }
137
TEST(X32_ZIP_XM__NEON,n_eq_4_m_div_4)138 TEST(X32_ZIP_XM__NEON, n_eq_4_m_div_4) {
139 TEST_REQUIRES_ARM_NEON;
140 for (size_t g = 4; g < 32; g += 4) {
141 ZipMicrokernelTester()
142 .n(4)
143 .g(g)
144 .Test(xnn_x32_zip_xm_ukernel__neon);
145 }
146 }
147
TEST(X32_ZIP_XM__NEON,n_eq_4_m_gt_4)148 TEST(X32_ZIP_XM__NEON, n_eq_4_m_gt_4) {
149 TEST_REQUIRES_ARM_NEON;
150 for (size_t g = 5; g < 8; g++) {
151 ZipMicrokernelTester()
152 .n(4)
153 .g(g)
154 .Test(xnn_x32_zip_xm_ukernel__neon);
155 }
156 }
157
TEST(X32_ZIP_XM__NEON,n_div_4_m_eq_4)158 TEST(X32_ZIP_XM__NEON, n_div_4_m_eq_4) {
159 TEST_REQUIRES_ARM_NEON;
160 for (size_t n = 4; n < 64; n += 4) {
161 ZipMicrokernelTester()
162 .n(n)
163 .g(4)
164 .Test(xnn_x32_zip_xm_ukernel__neon);
165 }
166 }
167
TEST(X32_ZIP_XM__NEON,n_div_4_m_div_4)168 TEST(X32_ZIP_XM__NEON, n_div_4_m_div_4) {
169 TEST_REQUIRES_ARM_NEON;
170 for (size_t n = 4; n < 64; n += 4) {
171 for (size_t g = 4; g < 32; g += 4) {
172 ZipMicrokernelTester()
173 .n(n)
174 .g(g)
175 .Test(xnn_x32_zip_xm_ukernel__neon);
176 }
177 }
178 }
179
TEST(X32_ZIP_XM__NEON,n_div_4_m_gt_4)180 TEST(X32_ZIP_XM__NEON, n_div_4_m_gt_4) {
181 TEST_REQUIRES_ARM_NEON;
182 for (size_t n = 4; n < 64; n += 4) {
183 for (size_t g = 5; g < 8; g++) {
184 ZipMicrokernelTester()
185 .n(n)
186 .g(g)
187 .Test(xnn_x32_zip_xm_ukernel__neon);
188 }
189 }
190 }
191
TEST(X32_ZIP_XM__NEON,n_gt_4_m_eq_4)192 TEST(X32_ZIP_XM__NEON, n_gt_4_m_eq_4) {
193 TEST_REQUIRES_ARM_NEON;
194 for (size_t n = 5; n < 8; n++) {
195 ZipMicrokernelTester()
196 .n(n)
197 .g(4)
198 .Test(xnn_x32_zip_xm_ukernel__neon);
199 }
200 }
201
TEST(X32_ZIP_XM__NEON,n_gt_4_m_div_4)202 TEST(X32_ZIP_XM__NEON, n_gt_4_m_div_4) {
203 TEST_REQUIRES_ARM_NEON;
204 for (size_t n = 5; n < 8; n++) {
205 for (size_t g = 4; g < 32; g += 4) {
206 ZipMicrokernelTester()
207 .n(n)
208 .g(g)
209 .Test(xnn_x32_zip_xm_ukernel__neon);
210 }
211 }
212 }
213
TEST(X32_ZIP_XM__NEON,n_gt_4_m_gt_4)214 TEST(X32_ZIP_XM__NEON, n_gt_4_m_gt_4) {
215 TEST_REQUIRES_ARM_NEON;
216 for (size_t n = 5; n < 8; n++) {
217 for (size_t g = 5; g < 8; g++) {
218 ZipMicrokernelTester()
219 .n(n)
220 .g(g)
221 .Test(xnn_x32_zip_xm_ukernel__neon);
222 }
223 }
224 }
225
TEST(X32_ZIP_XM__NEON,n_lt_4_m_eq_4)226 TEST(X32_ZIP_XM__NEON, n_lt_4_m_eq_4) {
227 TEST_REQUIRES_ARM_NEON;
228 for (size_t n = 1; n < 4; n++) {
229 ZipMicrokernelTester()
230 .n(n)
231 .g(4)
232 .Test(xnn_x32_zip_xm_ukernel__neon);
233 }
234 }
235
TEST(X32_ZIP_XM__NEON,n_lt_4_m_div_4)236 TEST(X32_ZIP_XM__NEON, n_lt_4_m_div_4) {
237 TEST_REQUIRES_ARM_NEON;
238 for (size_t n = 1; n < 4; n++) {
239 for (size_t g = 4; g < 32; g += 4) {
240 ZipMicrokernelTester()
241 .n(n)
242 .g(g)
243 .Test(xnn_x32_zip_xm_ukernel__neon);
244 }
245 }
246 }
247
TEST(X32_ZIP_XM__NEON,n_lt_4_m_gt_4)248 TEST(X32_ZIP_XM__NEON, n_lt_4_m_gt_4) {
249 TEST_REQUIRES_ARM_NEON;
250 for (size_t n = 1; n < 4; n++) {
251 for (size_t g = 5; g < 8; g++) {
252 ZipMicrokernelTester()
253 .n(n)
254 .g(g)
255 .Test(xnn_x32_zip_xm_ukernel__neon);
256 }
257 }
258 }
259 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
260
261 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(X32_ZIP_X2__SSE2,n_eq_4)262 TEST(X32_ZIP_X2__SSE2, n_eq_4) {
263 TEST_REQUIRES_X86_SSE2;
264 ZipMicrokernelTester()
265 .n(4)
266 .g(2)
267 .Test(xnn_x32_zip_x2_ukernel__sse2);
268 }
269
TEST(X32_ZIP_X2__SSE2,n_div_4)270 TEST(X32_ZIP_X2__SSE2, n_div_4) {
271 TEST_REQUIRES_X86_SSE2;
272 for (size_t n = 4; n < 64; n += 4) {
273 ZipMicrokernelTester()
274 .n(n)
275 .g(2)
276 .Test(xnn_x32_zip_x2_ukernel__sse2);
277 }
278 }
279
TEST(X32_ZIP_X2__SSE2,n_gt_4)280 TEST(X32_ZIP_X2__SSE2, n_gt_4) {
281 TEST_REQUIRES_X86_SSE2;
282 for (size_t n = 5; n < 8; n++) {
283 ZipMicrokernelTester()
284 .n(n)
285 .g(2)
286 .Test(xnn_x32_zip_x2_ukernel__sse2);
287 }
288 }
289
TEST(X32_ZIP_X2__SSE2,n_lt_4)290 TEST(X32_ZIP_X2__SSE2, n_lt_4) {
291 TEST_REQUIRES_X86_SSE2;
292 for (size_t n = 1; n < 4; n++) {
293 ZipMicrokernelTester()
294 .n(n)
295 .g(2)
296 .Test(xnn_x32_zip_x2_ukernel__sse2);
297 }
298 }
299
TEST(X32_ZIP_X3__SSE2,n_eq_4)300 TEST(X32_ZIP_X3__SSE2, n_eq_4) {
301 TEST_REQUIRES_X86_SSE2;
302 ZipMicrokernelTester()
303 .n(4)
304 .g(3)
305 .Test(xnn_x32_zip_x3_ukernel__sse2);
306 }
307
TEST(X32_ZIP_X3__SSE2,n_div_4)308 TEST(X32_ZIP_X3__SSE2, n_div_4) {
309 TEST_REQUIRES_X86_SSE2;
310 for (size_t n = 4; n < 64; n += 4) {
311 ZipMicrokernelTester()
312 .n(n)
313 .g(3)
314 .Test(xnn_x32_zip_x3_ukernel__sse2);
315 }
316 }
317
TEST(X32_ZIP_X3__SSE2,n_gt_4)318 TEST(X32_ZIP_X3__SSE2, n_gt_4) {
319 TEST_REQUIRES_X86_SSE2;
320 for (size_t n = 5; n < 8; n++) {
321 ZipMicrokernelTester()
322 .n(n)
323 .g(3)
324 .Test(xnn_x32_zip_x3_ukernel__sse2);
325 }
326 }
327
TEST(X32_ZIP_X3__SSE2,n_lt_4)328 TEST(X32_ZIP_X3__SSE2, n_lt_4) {
329 TEST_REQUIRES_X86_SSE2;
330 for (size_t n = 1; n < 4; n++) {
331 ZipMicrokernelTester()
332 .n(n)
333 .g(3)
334 .Test(xnn_x32_zip_x3_ukernel__sse2);
335 }
336 }
337
TEST(X32_ZIP_X4__SSE2,n_eq_4)338 TEST(X32_ZIP_X4__SSE2, n_eq_4) {
339 TEST_REQUIRES_X86_SSE2;
340 ZipMicrokernelTester()
341 .n(4)
342 .g(4)
343 .Test(xnn_x32_zip_x4_ukernel__sse2);
344 }
345
TEST(X32_ZIP_X4__SSE2,n_div_4)346 TEST(X32_ZIP_X4__SSE2, n_div_4) {
347 TEST_REQUIRES_X86_SSE2;
348 for (size_t n = 4; n < 64; n += 4) {
349 ZipMicrokernelTester()
350 .n(n)
351 .g(4)
352 .Test(xnn_x32_zip_x4_ukernel__sse2);
353 }
354 }
355
TEST(X32_ZIP_X4__SSE2,n_gt_4)356 TEST(X32_ZIP_X4__SSE2, n_gt_4) {
357 TEST_REQUIRES_X86_SSE2;
358 for (size_t n = 5; n < 8; n++) {
359 ZipMicrokernelTester()
360 .n(n)
361 .g(4)
362 .Test(xnn_x32_zip_x4_ukernel__sse2);
363 }
364 }
365
TEST(X32_ZIP_X4__SSE2,n_lt_4)366 TEST(X32_ZIP_X4__SSE2, n_lt_4) {
367 TEST_REQUIRES_X86_SSE2;
368 for (size_t n = 1; n < 4; n++) {
369 ZipMicrokernelTester()
370 .n(n)
371 .g(4)
372 .Test(xnn_x32_zip_x4_ukernel__sse2);
373 }
374 }
375
TEST(X32_ZIP_XM__SSE2,n_eq_4_m_eq_4)376 TEST(X32_ZIP_XM__SSE2, n_eq_4_m_eq_4) {
377 TEST_REQUIRES_X86_SSE2;
378 ZipMicrokernelTester()
379 .n(4)
380 .g(4)
381 .Test(xnn_x32_zip_xm_ukernel__sse2);
382 }
383
TEST(X32_ZIP_XM__SSE2,n_eq_4_m_div_4)384 TEST(X32_ZIP_XM__SSE2, n_eq_4_m_div_4) {
385 TEST_REQUIRES_X86_SSE2;
386 for (size_t g = 4; g < 32; g += 4) {
387 ZipMicrokernelTester()
388 .n(4)
389 .g(g)
390 .Test(xnn_x32_zip_xm_ukernel__sse2);
391 }
392 }
393
TEST(X32_ZIP_XM__SSE2,n_eq_4_m_gt_4)394 TEST(X32_ZIP_XM__SSE2, n_eq_4_m_gt_4) {
395 TEST_REQUIRES_X86_SSE2;
396 for (size_t g = 5; g < 8; g++) {
397 ZipMicrokernelTester()
398 .n(4)
399 .g(g)
400 .Test(xnn_x32_zip_xm_ukernel__sse2);
401 }
402 }
403
TEST(X32_ZIP_XM__SSE2,n_div_4_m_eq_4)404 TEST(X32_ZIP_XM__SSE2, n_div_4_m_eq_4) {
405 TEST_REQUIRES_X86_SSE2;
406 for (size_t n = 4; n < 64; n += 4) {
407 ZipMicrokernelTester()
408 .n(n)
409 .g(4)
410 .Test(xnn_x32_zip_xm_ukernel__sse2);
411 }
412 }
413
TEST(X32_ZIP_XM__SSE2,n_div_4_m_div_4)414 TEST(X32_ZIP_XM__SSE2, n_div_4_m_div_4) {
415 TEST_REQUIRES_X86_SSE2;
416 for (size_t n = 4; n < 64; n += 4) {
417 for (size_t g = 4; g < 32; g += 4) {
418 ZipMicrokernelTester()
419 .n(n)
420 .g(g)
421 .Test(xnn_x32_zip_xm_ukernel__sse2);
422 }
423 }
424 }
425
TEST(X32_ZIP_XM__SSE2,n_div_4_m_gt_4)426 TEST(X32_ZIP_XM__SSE2, n_div_4_m_gt_4) {
427 TEST_REQUIRES_X86_SSE2;
428 for (size_t n = 4; n < 64; n += 4) {
429 for (size_t g = 5; g < 8; g++) {
430 ZipMicrokernelTester()
431 .n(n)
432 .g(g)
433 .Test(xnn_x32_zip_xm_ukernel__sse2);
434 }
435 }
436 }
437
TEST(X32_ZIP_XM__SSE2,n_gt_4_m_eq_4)438 TEST(X32_ZIP_XM__SSE2, n_gt_4_m_eq_4) {
439 TEST_REQUIRES_X86_SSE2;
440 for (size_t n = 5; n < 8; n++) {
441 ZipMicrokernelTester()
442 .n(n)
443 .g(4)
444 .Test(xnn_x32_zip_xm_ukernel__sse2);
445 }
446 }
447
TEST(X32_ZIP_XM__SSE2,n_gt_4_m_div_4)448 TEST(X32_ZIP_XM__SSE2, n_gt_4_m_div_4) {
449 TEST_REQUIRES_X86_SSE2;
450 for (size_t n = 5; n < 8; n++) {
451 for (size_t g = 4; g < 32; g += 4) {
452 ZipMicrokernelTester()
453 .n(n)
454 .g(g)
455 .Test(xnn_x32_zip_xm_ukernel__sse2);
456 }
457 }
458 }
459
TEST(X32_ZIP_XM__SSE2,n_gt_4_m_gt_4)460 TEST(X32_ZIP_XM__SSE2, n_gt_4_m_gt_4) {
461 TEST_REQUIRES_X86_SSE2;
462 for (size_t n = 5; n < 8; n++) {
463 for (size_t g = 5; g < 8; g++) {
464 ZipMicrokernelTester()
465 .n(n)
466 .g(g)
467 .Test(xnn_x32_zip_xm_ukernel__sse2);
468 }
469 }
470 }
471
TEST(X32_ZIP_XM__SSE2,n_lt_4_m_eq_4)472 TEST(X32_ZIP_XM__SSE2, n_lt_4_m_eq_4) {
473 TEST_REQUIRES_X86_SSE2;
474 for (size_t n = 1; n < 4; n++) {
475 ZipMicrokernelTester()
476 .n(n)
477 .g(4)
478 .Test(xnn_x32_zip_xm_ukernel__sse2);
479 }
480 }
481
TEST(X32_ZIP_XM__SSE2,n_lt_4_m_div_4)482 TEST(X32_ZIP_XM__SSE2, n_lt_4_m_div_4) {
483 TEST_REQUIRES_X86_SSE2;
484 for (size_t n = 1; n < 4; n++) {
485 for (size_t g = 4; g < 32; g += 4) {
486 ZipMicrokernelTester()
487 .n(n)
488 .g(g)
489 .Test(xnn_x32_zip_xm_ukernel__sse2);
490 }
491 }
492 }
493
TEST(X32_ZIP_XM__SSE2,n_lt_4_m_gt_4)494 TEST(X32_ZIP_XM__SSE2, n_lt_4_m_gt_4) {
495 TEST_REQUIRES_X86_SSE2;
496 for (size_t n = 1; n < 4; n++) {
497 for (size_t g = 5; g < 8; g++) {
498 ZipMicrokernelTester()
499 .n(n)
500 .g(g)
501 .Test(xnn_x32_zip_xm_ukernel__sse2);
502 }
503 }
504 }
505 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
506
507 #if XNN_ARCH_WASMSIMD
TEST(X32_ZIP_X2__WASMSIMD,n_eq_4)508 TEST(X32_ZIP_X2__WASMSIMD, n_eq_4) {
509 ZipMicrokernelTester()
510 .n(4)
511 .g(2)
512 .Test(xnn_x32_zip_x2_ukernel__wasmsimd);
513 }
514
TEST(X32_ZIP_X2__WASMSIMD,n_div_4)515 TEST(X32_ZIP_X2__WASMSIMD, n_div_4) {
516 for (size_t n = 4; n < 64; n += 4) {
517 ZipMicrokernelTester()
518 .n(n)
519 .g(2)
520 .Test(xnn_x32_zip_x2_ukernel__wasmsimd);
521 }
522 }
523
TEST(X32_ZIP_X2__WASMSIMD,n_gt_4)524 TEST(X32_ZIP_X2__WASMSIMD, n_gt_4) {
525 for (size_t n = 5; n < 8; n++) {
526 ZipMicrokernelTester()
527 .n(n)
528 .g(2)
529 .Test(xnn_x32_zip_x2_ukernel__wasmsimd);
530 }
531 }
532
TEST(X32_ZIP_X2__WASMSIMD,n_lt_4)533 TEST(X32_ZIP_X2__WASMSIMD, n_lt_4) {
534 for (size_t n = 1; n < 4; n++) {
535 ZipMicrokernelTester()
536 .n(n)
537 .g(2)
538 .Test(xnn_x32_zip_x2_ukernel__wasmsimd);
539 }
540 }
541
TEST(X32_ZIP_X3__WASMSIMD,n_eq_4)542 TEST(X32_ZIP_X3__WASMSIMD, n_eq_4) {
543 ZipMicrokernelTester()
544 .n(4)
545 .g(3)
546 .Test(xnn_x32_zip_x3_ukernel__wasmsimd);
547 }
548
TEST(X32_ZIP_X3__WASMSIMD,n_div_4)549 TEST(X32_ZIP_X3__WASMSIMD, n_div_4) {
550 for (size_t n = 4; n < 64; n += 4) {
551 ZipMicrokernelTester()
552 .n(n)
553 .g(3)
554 .Test(xnn_x32_zip_x3_ukernel__wasmsimd);
555 }
556 }
557
TEST(X32_ZIP_X3__WASMSIMD,n_gt_4)558 TEST(X32_ZIP_X3__WASMSIMD, n_gt_4) {
559 for (size_t n = 5; n < 8; n++) {
560 ZipMicrokernelTester()
561 .n(n)
562 .g(3)
563 .Test(xnn_x32_zip_x3_ukernel__wasmsimd);
564 }
565 }
566
TEST(X32_ZIP_X3__WASMSIMD,n_lt_4)567 TEST(X32_ZIP_X3__WASMSIMD, n_lt_4) {
568 for (size_t n = 1; n < 4; n++) {
569 ZipMicrokernelTester()
570 .n(n)
571 .g(3)
572 .Test(xnn_x32_zip_x3_ukernel__wasmsimd);
573 }
574 }
575
TEST(X32_ZIP_X4__WASMSIMD,n_eq_4)576 TEST(X32_ZIP_X4__WASMSIMD, n_eq_4) {
577 ZipMicrokernelTester()
578 .n(4)
579 .g(4)
580 .Test(xnn_x32_zip_x4_ukernel__wasmsimd);
581 }
582
TEST(X32_ZIP_X4__WASMSIMD,n_div_4)583 TEST(X32_ZIP_X4__WASMSIMD, n_div_4) {
584 for (size_t n = 4; n < 64; n += 4) {
585 ZipMicrokernelTester()
586 .n(n)
587 .g(4)
588 .Test(xnn_x32_zip_x4_ukernel__wasmsimd);
589 }
590 }
591
TEST(X32_ZIP_X4__WASMSIMD,n_gt_4)592 TEST(X32_ZIP_X4__WASMSIMD, n_gt_4) {
593 for (size_t n = 5; n < 8; n++) {
594 ZipMicrokernelTester()
595 .n(n)
596 .g(4)
597 .Test(xnn_x32_zip_x4_ukernel__wasmsimd);
598 }
599 }
600
TEST(X32_ZIP_X4__WASMSIMD,n_lt_4)601 TEST(X32_ZIP_X4__WASMSIMD, n_lt_4) {
602 for (size_t n = 1; n < 4; n++) {
603 ZipMicrokernelTester()
604 .n(n)
605 .g(4)
606 .Test(xnn_x32_zip_x4_ukernel__wasmsimd);
607 }
608 }
609
TEST(X32_ZIP_XM__WASMSIMD,n_eq_4_m_eq_4)610 TEST(X32_ZIP_XM__WASMSIMD, n_eq_4_m_eq_4) {
611 ZipMicrokernelTester()
612 .n(4)
613 .g(4)
614 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
615 }
616
TEST(X32_ZIP_XM__WASMSIMD,n_eq_4_m_div_4)617 TEST(X32_ZIP_XM__WASMSIMD, n_eq_4_m_div_4) {
618 for (size_t g = 4; g < 32; g += 4) {
619 ZipMicrokernelTester()
620 .n(4)
621 .g(g)
622 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
623 }
624 }
625
TEST(X32_ZIP_XM__WASMSIMD,n_eq_4_m_gt_4)626 TEST(X32_ZIP_XM__WASMSIMD, n_eq_4_m_gt_4) {
627 for (size_t g = 5; g < 8; g++) {
628 ZipMicrokernelTester()
629 .n(4)
630 .g(g)
631 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
632 }
633 }
634
TEST(X32_ZIP_XM__WASMSIMD,n_div_4_m_eq_4)635 TEST(X32_ZIP_XM__WASMSIMD, n_div_4_m_eq_4) {
636 for (size_t n = 4; n < 64; n += 4) {
637 ZipMicrokernelTester()
638 .n(n)
639 .g(4)
640 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
641 }
642 }
643
TEST(X32_ZIP_XM__WASMSIMD,n_div_4_m_div_4)644 TEST(X32_ZIP_XM__WASMSIMD, n_div_4_m_div_4) {
645 for (size_t n = 4; n < 64; n += 4) {
646 for (size_t g = 4; g < 32; g += 4) {
647 ZipMicrokernelTester()
648 .n(n)
649 .g(g)
650 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
651 }
652 }
653 }
654
TEST(X32_ZIP_XM__WASMSIMD,n_div_4_m_gt_4)655 TEST(X32_ZIP_XM__WASMSIMD, n_div_4_m_gt_4) {
656 for (size_t n = 4; n < 64; n += 4) {
657 for (size_t g = 5; g < 8; g++) {
658 ZipMicrokernelTester()
659 .n(n)
660 .g(g)
661 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
662 }
663 }
664 }
665
TEST(X32_ZIP_XM__WASMSIMD,n_gt_4_m_eq_4)666 TEST(X32_ZIP_XM__WASMSIMD, n_gt_4_m_eq_4) {
667 for (size_t n = 5; n < 8; n++) {
668 ZipMicrokernelTester()
669 .n(n)
670 .g(4)
671 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
672 }
673 }
674
TEST(X32_ZIP_XM__WASMSIMD,n_gt_4_m_div_4)675 TEST(X32_ZIP_XM__WASMSIMD, n_gt_4_m_div_4) {
676 for (size_t n = 5; n < 8; n++) {
677 for (size_t g = 4; g < 32; g += 4) {
678 ZipMicrokernelTester()
679 .n(n)
680 .g(g)
681 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
682 }
683 }
684 }
685
TEST(X32_ZIP_XM__WASMSIMD,n_gt_4_m_gt_4)686 TEST(X32_ZIP_XM__WASMSIMD, n_gt_4_m_gt_4) {
687 for (size_t n = 5; n < 8; n++) {
688 for (size_t g = 5; g < 8; g++) {
689 ZipMicrokernelTester()
690 .n(n)
691 .g(g)
692 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
693 }
694 }
695 }
696
TEST(X32_ZIP_XM__WASMSIMD,n_lt_4_m_eq_4)697 TEST(X32_ZIP_XM__WASMSIMD, n_lt_4_m_eq_4) {
698 for (size_t n = 1; n < 4; n++) {
699 ZipMicrokernelTester()
700 .n(n)
701 .g(4)
702 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
703 }
704 }
705
TEST(X32_ZIP_XM__WASMSIMD,n_lt_4_m_div_4)706 TEST(X32_ZIP_XM__WASMSIMD, n_lt_4_m_div_4) {
707 for (size_t n = 1; n < 4; n++) {
708 for (size_t g = 4; g < 32; g += 4) {
709 ZipMicrokernelTester()
710 .n(n)
711 .g(g)
712 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
713 }
714 }
715 }
716
TEST(X32_ZIP_XM__WASMSIMD,n_lt_4_m_gt_4)717 TEST(X32_ZIP_XM__WASMSIMD, n_lt_4_m_gt_4) {
718 for (size_t n = 1; n < 4; n++) {
719 for (size_t g = 5; g < 8; g++) {
720 ZipMicrokernelTester()
721 .n(n)
722 .g(g)
723 .Test(xnn_x32_zip_xm_ukernel__wasmsimd);
724 }
725 }
726 }
727 #endif // XNN_ARCH_WASMSIMD
728
TEST(X32_ZIP_X2__SCALAR,n_eq_1)729 TEST(X32_ZIP_X2__SCALAR, n_eq_1) {
730 ZipMicrokernelTester()
731 .n(1)
732 .g(2)
733 .Test(xnn_x32_zip_x2_ukernel__scalar);
734 }
735
TEST(X32_ZIP_X2__SCALAR,n_gt_1)736 TEST(X32_ZIP_X2__SCALAR, n_gt_1) {
737 for (size_t n = 2; n < 8; n++) {
738 ZipMicrokernelTester()
739 .n(n)
740 .g(2)
741 .Test(xnn_x32_zip_x2_ukernel__scalar);
742 }
743 }
744
TEST(X32_ZIP_X3__SCALAR,n_eq_1)745 TEST(X32_ZIP_X3__SCALAR, n_eq_1) {
746 ZipMicrokernelTester()
747 .n(9)
748 .g(3)
749 .Test(xnn_x32_zip_x3_ukernel__scalar);
750 }
751
TEST(X32_ZIP_X3__SCALAR,n_gt_1)752 TEST(X32_ZIP_X3__SCALAR, n_gt_1) {
753 for (size_t n = 2; n < 8; n++) {
754 ZipMicrokernelTester()
755 .n(n)
756 .g(3)
757 .Test(xnn_x32_zip_x3_ukernel__scalar);
758 }
759 }
760
TEST(X32_ZIP_X4__SCALAR,n_eq_1)761 TEST(X32_ZIP_X4__SCALAR, n_eq_1) {
762 ZipMicrokernelTester()
763 .n(1)
764 .g(4)
765 .Test(xnn_x32_zip_x4_ukernel__scalar);
766 }
767
TEST(X32_ZIP_X4__SCALAR,n_gt_1)768 TEST(X32_ZIP_X4__SCALAR, n_gt_1) {
769 for (size_t n = 2; n < 8; n++) {
770 ZipMicrokernelTester()
771 .n(n)
772 .g(4)
773 .Test(xnn_x32_zip_x4_ukernel__scalar);
774 }
775 }
776
TEST(X32_ZIP_XM__SCALAR,n_eq_1_m_eq_4)777 TEST(X32_ZIP_XM__SCALAR, n_eq_1_m_eq_4) {
778 ZipMicrokernelTester()
779 .n(1)
780 .g(4)
781 .Test(xnn_x32_zip_xm_ukernel__scalar);
782 }
783
TEST(X32_ZIP_XM__SCALAR,n_eq_1_m_div_4)784 TEST(X32_ZIP_XM__SCALAR, n_eq_1_m_div_4) {
785 for (size_t g = 4; g < 32; g += 4) {
786 ZipMicrokernelTester()
787 .n(1)
788 .g(g)
789 .Test(xnn_x32_zip_xm_ukernel__scalar);
790 }
791 }
792
TEST(X32_ZIP_XM__SCALAR,n_eq_1_m_gt_4)793 TEST(X32_ZIP_XM__SCALAR, n_eq_1_m_gt_4) {
794 for (size_t g = 5; g < 8; g++) {
795 ZipMicrokernelTester()
796 .n(1)
797 .g(g)
798 .Test(xnn_x32_zip_xm_ukernel__scalar);
799 }
800 }
801
TEST(X32_ZIP_XM__SCALAR,n_gt_1_m_eq_4)802 TEST(X32_ZIP_XM__SCALAR, n_gt_1_m_eq_4) {
803 for (size_t n = 2; n < 8; n++) {
804 ZipMicrokernelTester()
805 .n(n)
806 .g(4)
807 .Test(xnn_x32_zip_xm_ukernel__scalar);
808 }
809 }
810
TEST(X32_ZIP_XM__SCALAR,n_gt_1_m_div_4)811 TEST(X32_ZIP_XM__SCALAR, n_gt_1_m_div_4) {
812 for (size_t n = 2; n < 8; n++) {
813 for (size_t g = 4; g < 32; g += 4) {
814 ZipMicrokernelTester()
815 .n(n)
816 .g(g)
817 .Test(xnn_x32_zip_xm_ukernel__scalar);
818 }
819 }
820 }
821
TEST(X32_ZIP_XM__SCALAR,n_gt_1_m_gt_4)822 TEST(X32_ZIP_XM__SCALAR, n_gt_1_m_gt_4) {
823 for (size_t n = 2; n < 8; n++) {
824 for (size_t g = 5; g < 8; g++) {
825 ZipMicrokernelTester()
826 .n(n)
827 .g(g)
828 .Test(xnn_x32_zip_xm_ukernel__scalar);
829 }
830 }
831 }
832