Debian Codegraph @

src/x16-packw/gen/x16-packw-x8-gemm-goi-neon-ld4lane-u12-prfm.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/x16-packw/neon.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2023 Google LLC
6 //
7 // This source code is licensed under the BSD-style license found in the
8 // LICENSE file in the root directory of this source tree.
9
10
11 #include <assert.h>
12 #include <stddef.h>
13 #include <stdint.h>
14
15 #include <arm_neon.h>
16
17 #include "xnnpack/packw.h"
18 #include "xnnpack/prefetch.h"
19
20
21 void xnn_x16_packw_gemm_goi_ukernel_x8__neon_ld4lane_u12_prfm(
22 size_t g,
23 size_t nc,
24 size_t kc,
25 size_t nr,
26 size_t kr,
27 size_t sr,
28 const uint16_t* weights,
29 const uint16_t* bias,
30 const void* scale,
31 uint16_t* packed_weights,
32 size_t extra_bytes,
33 const void* params)
34 {
35 assert(g != 0);
36 assert(nc != 0);
37 assert(kc != 0);
38 assert(nr == 8);
39 assert(kr == 1);
40 assert(sr == 1);
41 assert(weights != NULL);
42 assert(packed_weights != NULL);
43
44 uint16x8x4_t vtmp0123x01234567;
45 vtmp0123x01234567.val[0] = vdupq_n_u16(0);
46 vtmp0123x01234567.val[1] = vdupq_n_u16(0);
47 vtmp0123x01234567.val[2] = vdupq_n_u16(0);
48 vtmp0123x01234567.val[3] = vdupq_n_u16(0);
49 uint16x8x4_t vtmp4567x01234567;
50 vtmp4567x01234567.val[0] = vdupq_n_u16(0);
51 vtmp4567x01234567.val[1] = vdupq_n_u16(0);
52 vtmp4567x01234567.val[2] = vdupq_n_u16(0);
53 vtmp4567x01234567.val[3] = vdupq_n_u16(0);
54 uint16x8x4_t vtmp89ABx01234567;
55 vtmp89ABx01234567.val[0] = vdupq_n_u16(0);
56 vtmp89ABx01234567.val[1] = vdupq_n_u16(0);
57 vtmp89ABx01234567.val[2] = vdupq_n_u16(0);
58 vtmp89ABx01234567.val[3] = vdupq_n_u16(0);
59
60 do {
61 // NC main loop multiple of 8
62 const uint16_t* w0 = weights;
63 size_t n = nc;
64
65 for (; n >= 8; n -= 8) {
66 if XNN_LIKELY(bias != NULL) {
67 uint16x8_t vb0 = vld1q_u16(bias); bias += 8;
68 vst1q_u16(packed_weights, vb0); packed_weights += 8;
69 } else {
70 const uint16x8_t vzero = vmovq_n_u16(0);
71 vst1q_u16(packed_weights, vzero); packed_weights += 8;
72 }
73
74 const uint16_t* w1 = w0 + kc;
75 const uint16_t* w2 = w1 + kc;
76 const uint16_t* w3 = w2 + kc;
77 const uint16_t* w4 = w3 + kc;
78 const uint16_t* w5 = w4 + kc;
79 const uint16_t* w6 = w5 + kc;
80 const uint16_t* w7 = w6 + kc;
81 xnn_prefetch_to_l1((const int8_t*) w0);
82 xnn_prefetch_to_l1((const int8_t*) w0 + 64);
83 xnn_prefetch_to_l1((const int8_t*) w1);
84 xnn_prefetch_to_l1((const int8_t*) w1 + 64);
85 xnn_prefetch_to_l1((const int8_t*) w2);
86 xnn_prefetch_to_l1((const int8_t*) w2 + 64);
87 xnn_prefetch_to_l1((const int8_t*) w3);
88 xnn_prefetch_to_l1((const int8_t*) w3 + 64);
89 xnn_prefetch_to_l1((const int8_t*) w4);
90 xnn_prefetch_to_l1((const int8_t*) w4 + 64);
91 xnn_prefetch_to_l1((const int8_t*) w5);
92 xnn_prefetch_to_l1((const int8_t*) w5 + 64);
93 xnn_prefetch_to_l1((const int8_t*) w6);
94 xnn_prefetch_to_l1((const int8_t*) w6 + 64);
95 xnn_prefetch_to_l1((const int8_t*) w7);
96 xnn_prefetch_to_l1((const int8_t*) w7 + 64);
97
98 // KC main loop multiple of 12
99 size_t k = kc;
100 for (; k >= 12; k -= 12) {
101 vtmp0123x01234567 = vld4q_lane_u16(w0, vtmp0123x01234567, 0); w0 += 4;
102 vtmp0123x01234567 = vld4q_lane_u16(w1, vtmp0123x01234567, 1); w1 += 4;
103 vtmp0123x01234567 = vld4q_lane_u16(w2, vtmp0123x01234567, 2); w2 += 4;
104 vtmp0123x01234567 = vld4q_lane_u16(w3, vtmp0123x01234567, 3); w3 += 4;
105 vtmp0123x01234567 = vld4q_lane_u16(w4, vtmp0123x01234567, 4); w4 += 4;
106 vtmp0123x01234567 = vld4q_lane_u16(w5, vtmp0123x01234567, 5); w5 += 4;
107 vtmp0123x01234567 = vld4q_lane_u16(w6, vtmp0123x01234567, 6); w6 += 4;
108 vtmp0123x01234567 = vld4q_lane_u16(w7, vtmp0123x01234567, 7); w7 += 4;
109 vtmp4567x01234567 = vld4q_lane_u16(w0, vtmp4567x01234567, 0); w0 += 4;
110 vtmp4567x01234567 = vld4q_lane_u16(w1, vtmp4567x01234567, 1); w1 += 4;
111 vtmp4567x01234567 = vld4q_lane_u16(w2, vtmp4567x01234567, 2); w2 += 4;
112 vtmp4567x01234567 = vld4q_lane_u16(w3, vtmp4567x01234567, 3); w3 += 4;
113 vtmp4567x01234567 = vld4q_lane_u16(w4, vtmp4567x01234567, 4); w4 += 4;
114 vtmp4567x01234567 = vld4q_lane_u16(w5, vtmp4567x01234567, 5); w5 += 4;
115 vtmp4567x01234567 = vld4q_lane_u16(w6, vtmp4567x01234567, 6); w6 += 4;
116 vtmp4567x01234567 = vld4q_lane_u16(w7, vtmp4567x01234567, 7); w7 += 4;
117 vtmp89ABx01234567 = vld4q_lane_u16(w0, vtmp89ABx01234567, 0); w0 += 4;
118 vtmp89ABx01234567 = vld4q_lane_u16(w1, vtmp89ABx01234567, 1); w1 += 4;
119 vtmp89ABx01234567 = vld4q_lane_u16(w2, vtmp89ABx01234567, 2); w2 += 4;
120 vtmp89ABx01234567 = vld4q_lane_u16(w3, vtmp89ABx01234567, 3); w3 += 4;
121 vtmp89ABx01234567 = vld4q_lane_u16(w4, vtmp89ABx01234567, 4); w4 += 4;
122 vtmp89ABx01234567 = vld4q_lane_u16(w5, vtmp89ABx01234567, 5); w5 += 4;
123 vtmp89ABx01234567 = vld4q_lane_u16(w6, vtmp89ABx01234567, 6); w6 += 4;
124 vtmp89ABx01234567 = vld4q_lane_u16(w7, vtmp89ABx01234567, 7); w7 += 4;
125 xnn_prefetch_to_l1((const int8_t*) w0 + 128);
126 xnn_prefetch_to_l1((const int8_t*) w1 + 128);
127 xnn_prefetch_to_l1((const int8_t*) w2 + 128);
128 xnn_prefetch_to_l1((const int8_t*) w3 + 128);
129 xnn_prefetch_to_l1((const int8_t*) w4 + 128);
130 xnn_prefetch_to_l1((const int8_t*) w5 + 128);
131 xnn_prefetch_to_l1((const int8_t*) w6 + 128);
132 xnn_prefetch_to_l1((const int8_t*) w7 + 128);
133 vst1q_u16(packed_weights, vtmp0123x01234567.val[0]); packed_weights += 8;
134 vst1q_u16(packed_weights, vtmp0123x01234567.val[1]); packed_weights += 8;
135 vst1q_u16(packed_weights, vtmp0123x01234567.val[2]); packed_weights += 8;
136 vst1q_u16(packed_weights, vtmp0123x01234567.val[3]); packed_weights += 8;
137 vst1q_u16(packed_weights, vtmp4567x01234567.val[0]); packed_weights += 8;
138 vst1q_u16(packed_weights, vtmp4567x01234567.val[1]); packed_weights += 8;
139 vst1q_u16(packed_weights, vtmp4567x01234567.val[2]); packed_weights += 8;
140 vst1q_u16(packed_weights, vtmp4567x01234567.val[3]); packed_weights += 8;
141 vst1q_u16(packed_weights, vtmp89ABx01234567.val[0]); packed_weights += 8;
142 vst1q_u16(packed_weights, vtmp89ABx01234567.val[1]); packed_weights += 8;
143 vst1q_u16(packed_weights, vtmp89ABx01234567.val[2]); packed_weights += 8;
144 vst1q_u16(packed_weights, vtmp89ABx01234567.val[3]); packed_weights += 8;
145 }
146 // KC remainder multiple of 4
147 while (k >= 4) {
148 vtmp0123x01234567 = vld4q_lane_u16(w0, vtmp0123x01234567, 0); w0 += 4;
149 vtmp0123x01234567 = vld4q_lane_u16(w1, vtmp0123x01234567, 1); w1 += 4;
150 vtmp0123x01234567 = vld4q_lane_u16(w2, vtmp0123x01234567, 2); w2 += 4;
151 vtmp0123x01234567 = vld4q_lane_u16(w3, vtmp0123x01234567, 3); w3 += 4;
152 vtmp0123x01234567 = vld4q_lane_u16(w4, vtmp0123x01234567, 4); w4 += 4;
153 vtmp0123x01234567 = vld4q_lane_u16(w5, vtmp0123x01234567, 5); w5 += 4;
154 vtmp0123x01234567 = vld4q_lane_u16(w6, vtmp0123x01234567, 6); w6 += 4;
155 vtmp0123x01234567 = vld4q_lane_u16(w7, vtmp0123x01234567, 7); w7 += 4;
156 vst1q_u16(packed_weights, vtmp0123x01234567.val[0]); packed_weights += 8;
157 vst1q_u16(packed_weights, vtmp0123x01234567.val[1]); packed_weights += 8;
158 vst1q_u16(packed_weights, vtmp0123x01234567.val[2]); packed_weights += 8;
159 vst1q_u16(packed_weights, vtmp0123x01234567.val[3]); packed_weights += 8;
160 k -= 4;
161 }
162
163 // KC remainder of 1..3
164 // Same as main loop but ld1, ld2 or ld3
165 if XNN_UNLIKELY(k != 0) {
166 assert(k >= 1);
167 assert(k <= 3);
168 switch (k) {
169 // KC remainder of 8x1
170 case 1:
171 {
172 uint16x8_t vtmp0x01234567 = vdupq_n_u16(0);
173
174 vtmp0x01234567 = vld1q_lane_u16(w0, vtmp0x01234567, 0); w0 += 1;
175 vtmp0x01234567 = vld1q_lane_u16(w1, vtmp0x01234567, 1); w1 += 1;
176 vtmp0x01234567 = vld1q_lane_u16(w2, vtmp0x01234567, 2); w2 += 1;
177 vtmp0x01234567 = vld1q_lane_u16(w3, vtmp0x01234567, 3); w3 += 1;
178 vtmp0x01234567 = vld1q_lane_u16(w4, vtmp0x01234567, 4); w4 += 1;
179 vtmp0x01234567 = vld1q_lane_u16(w5, vtmp0x01234567, 5); w5 += 1;
180 vtmp0x01234567 = vld1q_lane_u16(w6, vtmp0x01234567, 6); w6 += 1;
181 vtmp0x01234567 = vld1q_lane_u16(w7, vtmp0x01234567, 7); w7 += 1;
182
183 vst1q_u16(packed_weights, vtmp0x01234567); packed_weights += 8;
184 break;
185 }
186 // KC remainder of 8x2
187 case 2:
188 {
189 uint16x8x2_t vtmp01x01234567;
190 vtmp01x01234567.val[0] = vdupq_n_u16(0);
191 vtmp01x01234567.val[1] = vdupq_n_u16(0);
192
193 vtmp01x01234567 = vld2q_lane_u16(w0, vtmp01x01234567, 0); w0 += 2;
194 vtmp01x01234567 = vld2q_lane_u16(w1, vtmp01x01234567, 1); w1 += 2;
195 vtmp01x01234567 = vld2q_lane_u16(w2, vtmp01x01234567, 2); w2 += 2;
196 vtmp01x01234567 = vld2q_lane_u16(w3, vtmp01x01234567, 3); w3 += 2;
197 vtmp01x01234567 = vld2q_lane_u16(w4, vtmp01x01234567, 4); w4 += 2;
198 vtmp01x01234567 = vld2q_lane_u16(w5, vtmp01x01234567, 5); w5 += 2;
199 vtmp01x01234567 = vld2q_lane_u16(w6, vtmp01x01234567, 6); w6 += 2;
200 vtmp01x01234567 = vld2q_lane_u16(w7, vtmp01x01234567, 7); w7 += 2;
201
202 vst1q_u16(packed_weights, vtmp01x01234567.val[0]); packed_weights += 8;
203 vst1q_u16(packed_weights, vtmp01x01234567.val[1]); packed_weights += 8;
204 break;
205 }
206 // KC remainder of 8x3
207 case 3:
208 {
209 uint16x8x3_t vtmp012x01234567;
210 vtmp012x01234567.val[0] = vdupq_n_u16(0);
211 vtmp012x01234567.val[1] = vdupq_n_u16(0);
212 vtmp012x01234567.val[2] = vdupq_n_u16(0);
213
214 vtmp012x01234567 = vld3q_lane_u16(w0, vtmp012x01234567, 0); w0 += 3;
215 vtmp012x01234567 = vld3q_lane_u16(w1, vtmp012x01234567, 1); w1 += 3;
216 vtmp012x01234567 = vld3q_lane_u16(w2, vtmp012x01234567, 2); w2 += 3;
217 vtmp012x01234567 = vld3q_lane_u16(w3, vtmp012x01234567, 3); w3 += 3;
218 vtmp012x01234567 = vld3q_lane_u16(w4, vtmp012x01234567, 4); w4 += 3;
219 vtmp012x01234567 = vld3q_lane_u16(w5, vtmp012x01234567, 5); w5 += 3;
220 vtmp012x01234567 = vld3q_lane_u16(w6, vtmp012x01234567, 6); w6 += 3;
221 vtmp012x01234567 = vld3q_lane_u16(w7, vtmp012x01234567, 7); w7 += 3;
222
223 vst1q_u16(packed_weights, vtmp012x01234567.val[0]); packed_weights += 8;
224 vst1q_u16(packed_weights, vtmp012x01234567.val[1]); packed_weights += 8;
225 vst1q_u16(packed_weights, vtmp012x01234567.val[2]); packed_weights += 8;
226 break;
227 }
228 default:
229 XNN_UNREACHABLE;
230 }
231 }
232 packed_weights = (uint16_t*) ((uintptr_t) packed_weights + extra_bytes);
233 w0 = w7;
234 }
235
236 // NC remainder (1..7)
237 if XNN_UNLIKELY(n != 0) {
238 assert(n >= 1);
239 assert(n <= 7);
240 if XNN_LIKELY(bias != NULL) {
241 size_t nb = n;
242 do {
243 *packed_weights++ = *bias++;
244 } while (--nb != 0);
245 packed_weights += (8 - n);
246 } else {
247 const uint16x8_t vzero = vmovq_n_u16(0);
248 vst1q_u16(packed_weights, vzero); packed_weights += 8;
249 }
250
251 // NR remainder has less than 8 rows so last row is not loaded
252 const uint16_t* w1 = w0 + kc;
253 if XNN_UNPREDICTABLE(n < 2) {
254 w1 = w0;
255 }
256 const uint16_t* w2 = w1 + kc;
257 if XNN_UNPREDICTABLE(n <= 2) {
258 w2 = w1;
259 }
260 const uint16_t* w3 = w2 + kc;
261 if XNN_UNPREDICTABLE(n < 4) {
262 w3 = w2;
263 }
264 const uint16_t* w4 = w3 + kc;
265 if XNN_UNPREDICTABLE(n <= 4) {
266 w4 = w3;
267 }
268 const uint16_t* w5 = w4 + kc;
269 if XNN_UNPREDICTABLE(n < 6) {
270 w5 = w4;
271 }
272 const uint16_t* w6 = w5 + kc;
273 if XNN_UNPREDICTABLE(n <= 6) {
274 w6 = w5;
275 }
276
277 // KC main loop multiple of 12
278 size_t k = kc;
279 for (; k >= 12; k -= 12) {
280 vtmp0123x01234567 = vld4q_lane_u16(w0, vtmp0123x01234567, 0); w0 += 4;
281 vtmp0123x01234567 = vld4q_lane_u16(w1, vtmp0123x01234567, 1); w1 += 4;
282 vtmp0123x01234567 = vld4q_lane_u16(w2, vtmp0123x01234567, 2); w2 += 4;
283 vtmp0123x01234567 = vld4q_lane_u16(w3, vtmp0123x01234567, 3); w3 += 4;
284 vtmp0123x01234567 = vld4q_lane_u16(w4, vtmp0123x01234567, 4); w4 += 4;
285 vtmp0123x01234567 = vld4q_lane_u16(w5, vtmp0123x01234567, 5); w5 += 4;
286 vtmp0123x01234567 = vld4q_lane_u16(w6, vtmp0123x01234567, 6); w6 += 4;
287 vtmp4567x01234567 = vld4q_lane_u16(w0, vtmp4567x01234567, 0); w0 += 4;
288 vtmp4567x01234567 = vld4q_lane_u16(w1, vtmp4567x01234567, 1); w1 += 4;
289 vtmp4567x01234567 = vld4q_lane_u16(w2, vtmp4567x01234567, 2); w2 += 4;
290 vtmp4567x01234567 = vld4q_lane_u16(w3, vtmp4567x01234567, 3); w3 += 4;
291 vtmp4567x01234567 = vld4q_lane_u16(w4, vtmp4567x01234567, 4); w4 += 4;
292 vtmp4567x01234567 = vld4q_lane_u16(w5, vtmp4567x01234567, 5); w5 += 4;
293 vtmp4567x01234567 = vld4q_lane_u16(w6, vtmp4567x01234567, 6); w6 += 4;
294 vtmp89ABx01234567 = vld4q_lane_u16(w0, vtmp89ABx01234567, 0); w0 += 4;
295 vtmp89ABx01234567 = vld4q_lane_u16(w1, vtmp89ABx01234567, 1); w1 += 4;
296 vtmp89ABx01234567 = vld4q_lane_u16(w2, vtmp89ABx01234567, 2); w2 += 4;
297 vtmp89ABx01234567 = vld4q_lane_u16(w3, vtmp89ABx01234567, 3); w3 += 4;
298 vtmp89ABx01234567 = vld4q_lane_u16(w4, vtmp89ABx01234567, 4); w4 += 4;
299 vtmp89ABx01234567 = vld4q_lane_u16(w5, vtmp89ABx01234567, 5); w5 += 4;
300 vtmp89ABx01234567 = vld4q_lane_u16(w6, vtmp89ABx01234567, 6); w6 += 4;
301 xnn_prefetch_to_l1((const int8_t*) w0 + 128);
302 xnn_prefetch_to_l1((const int8_t*) w1 + 128);
303 xnn_prefetch_to_l1((const int8_t*) w2 + 128);
304 xnn_prefetch_to_l1((const int8_t*) w3 + 128);
305 xnn_prefetch_to_l1((const int8_t*) w4 + 128);
306 xnn_prefetch_to_l1((const int8_t*) w5 + 128);
307 xnn_prefetch_to_l1((const int8_t*) w6 + 128);
308 vst1q_u16(packed_weights, vtmp0123x01234567.val[0]); packed_weights += 8;
309 vst1q_u16(packed_weights, vtmp0123x01234567.val[1]); packed_weights += 8;
310 vst1q_u16(packed_weights, vtmp0123x01234567.val[2]); packed_weights += 8;
311 vst1q_u16(packed_weights, vtmp0123x01234567.val[3]); packed_weights += 8;
312 vst1q_u16(packed_weights, vtmp4567x01234567.val[0]); packed_weights += 8;
313 vst1q_u16(packed_weights, vtmp4567x01234567.val[1]); packed_weights += 8;
314 vst1q_u16(packed_weights, vtmp4567x01234567.val[2]); packed_weights += 8;
315 vst1q_u16(packed_weights, vtmp4567x01234567.val[3]); packed_weights += 8;
316 vst1q_u16(packed_weights, vtmp89ABx01234567.val[0]); packed_weights += 8;
317 vst1q_u16(packed_weights, vtmp89ABx01234567.val[1]); packed_weights += 8;
318 vst1q_u16(packed_weights, vtmp89ABx01234567.val[2]); packed_weights += 8;
319 vst1q_u16(packed_weights, vtmp89ABx01234567.val[3]); packed_weights += 8;
320 }
321
322 // KC remainder multiple of 4
323 while (k >= 4) {
324 vtmp0123x01234567 = vld4q_lane_u16(w0, vtmp0123x01234567, 0); w0 += 4;
325 vtmp0123x01234567 = vld4q_lane_u16(w1, vtmp0123x01234567, 1); w1 += 4;
326 vtmp0123x01234567 = vld4q_lane_u16(w2, vtmp0123x01234567, 2); w2 += 4;
327 vtmp0123x01234567 = vld4q_lane_u16(w3, vtmp0123x01234567, 3); w3 += 4;
328 vtmp0123x01234567 = vld4q_lane_u16(w4, vtmp0123x01234567, 4); w4 += 4;
329 vtmp0123x01234567 = vld4q_lane_u16(w5, vtmp0123x01234567, 5); w5 += 4;
330 vtmp0123x01234567 = vld4q_lane_u16(w6, vtmp0123x01234567, 6); w6 += 4;
331 vst1q_u16(packed_weights, vtmp0123x01234567.val[0]); packed_weights += 8;
332 vst1q_u16(packed_weights, vtmp0123x01234567.val[1]); packed_weights += 8;
333 vst1q_u16(packed_weights, vtmp0123x01234567.val[2]); packed_weights += 8;
334 vst1q_u16(packed_weights, vtmp0123x01234567.val[3]); packed_weights += 8;
335 k -= 4;
336 }
337
338 // KC remainder of 1..3
339 // Same as main loop but ld1, ld2 or ld3
340 if XNN_UNLIKELY(k != 0) {
341 assert(k >= 1);
342 assert(k <= 3);
343 switch (k) {
344 // KC remainder of 8x1
345 case 1:
346 {
347 uint16x8_t vtmp0x01234567 = vdupq_n_u16(0);
348
349 vtmp0x01234567 = vld1q_lane_u16(w0, vtmp0x01234567, 0); w0 += 1;
350 vtmp0x01234567 = vld1q_lane_u16(w1, vtmp0x01234567, 1); w1 += 1;
351 vtmp0x01234567 = vld1q_lane_u16(w2, vtmp0x01234567, 2); w2 += 1;
352 vtmp0x01234567 = vld1q_lane_u16(w3, vtmp0x01234567, 3); w3 += 1;
353 vtmp0x01234567 = vld1q_lane_u16(w4, vtmp0x01234567, 4); w4 += 1;
354 vtmp0x01234567 = vld1q_lane_u16(w5, vtmp0x01234567, 5); w5 += 1;
355 vtmp0x01234567 = vld1q_lane_u16(w6, vtmp0x01234567, 6); w6 += 1;
356
357 vst1q_u16(packed_weights, vtmp0x01234567); packed_weights += 8;
358 break;
359 }
360 // KC remainder of 8x2
361 case 2:
362 {
363 uint16x8x2_t vtmp01x01234567;
364 vtmp01x01234567.val[0] = vdupq_n_u16(0);
365 vtmp01x01234567.val[1] = vdupq_n_u16(0);
366
367 vtmp01x01234567 = vld2q_lane_u16(w0, vtmp01x01234567, 0); w0 += 2;
368 vtmp01x01234567 = vld2q_lane_u16(w1, vtmp01x01234567, 1); w1 += 2;
369 vtmp01x01234567 = vld2q_lane_u16(w2, vtmp01x01234567, 2); w2 += 2;
370 vtmp01x01234567 = vld2q_lane_u16(w3, vtmp01x01234567, 3); w3 += 2;
371 vtmp01x01234567 = vld2q_lane_u16(w4, vtmp01x01234567, 4); w4 += 2;
372 vtmp01x01234567 = vld2q_lane_u16(w5, vtmp01x01234567, 5); w5 += 2;
373 vtmp01x01234567 = vld2q_lane_u16(w6, vtmp01x01234567, 6); w6 += 2;
374
375 vst1q_u16(packed_weights, vtmp01x01234567.val[0]); packed_weights += 8;
376 vst1q_u16(packed_weights, vtmp01x01234567.val[1]); packed_weights += 8;
377 break;
378 }
379 // KC remainder of 8x3
380 case 3:
381 {
382 uint16x8x3_t vtmp012x01234567;
383 vtmp012x01234567.val[0] = vdupq_n_u16(0);
384 vtmp012x01234567.val[1] = vdupq_n_u16(0);
385 vtmp012x01234567.val[2] = vdupq_n_u16(0);
386
387 vtmp012x01234567 = vld3q_lane_u16(w0, vtmp012x01234567, 0); w0 += 3;
388 vtmp012x01234567 = vld3q_lane_u16(w1, vtmp012x01234567, 1); w1 += 3;
389 vtmp012x01234567 = vld3q_lane_u16(w2, vtmp012x01234567, 2); w2 += 3;
390 vtmp012x01234567 = vld3q_lane_u16(w3, vtmp012x01234567, 3); w3 += 3;
391 vtmp012x01234567 = vld3q_lane_u16(w4, vtmp012x01234567, 4); w4 += 3;
392 vtmp012x01234567 = vld3q_lane_u16(w5, vtmp012x01234567, 5); w5 += 3;
393 vtmp012x01234567 = vld3q_lane_u16(w6, vtmp012x01234567, 6); w6 += 3;
394
395 vst1q_u16(packed_weights, vtmp012x01234567.val[0]); packed_weights += 8;
396 vst1q_u16(packed_weights, vtmp012x01234567.val[1]); packed_weights += 8;
397 vst1q_u16(packed_weights, vtmp012x01234567.val[2]); packed_weights += 8;
398 break;
399 }
400 default:
401 XNN_UNREACHABLE;
402 }
403 }
404 packed_weights = (uint16_t*) ((uintptr_t) packed_weights + extra_bytes);
405 }
406
407 weights += nc * kc;
408 } while (--g != 0);
409 }