Debian Codegraph @

src/qs8-dwconv/gen/qs8-dwconv-8f8m9l8c8s8r-minmax-rndnu-neon-mul8-ld64.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/qs8-dwconv/multipass-neon-mul8.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
13 #include <arm_neon.h>
14
15 #include "xnnpack/dwconv.h"
16 #include "xnnpack/math.h"
17
18
19 void xnn_qs8_dwconv_minmax_rndnu_ukernel_8f8m9l8c8s8r__neon_mul8_ld64(
20 size_t channels,
21 size_t output_width,
22 const int8_t** input,
23 const void* weights,
24 int8_t* output,
25 intptr_t input_stride,
26 size_t output_increment,
27 size_t input_offset,
28 const int8_t* zero,
29 size_t kernel_size,
30 int32_t* buffer,
31 const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
32 {
33 assert(channels != 0);
34 assert(output_width != 0);
35 assert(kernel_size > 8);
36
37 const int32x4_t vright_pre_shift = vld1q_dup_s32(&params->rndnu_neon.right_pre_shift);
38 const int32x4_t vmultiplier = vld1q_dup_s32(&params->rndnu_neon.multiplier);
39 const int32x4_t vright_post_shift = vld1q_dup_s32(&params->rndnu_neon.right_post_shift);
40 const int16x8_t voutput_zero_point = vld1q_dup_s16(&params->rndnu_neon.output_zero_point);
41 const int8x8_t voutput_min = vld1_dup_s8(&params->rndnu_neon.output_min);
42 const int8x8_t voutput_max = vld1_dup_s8(&params->rndnu_neon.output_max);
43 do {
44 const void* w = weights;
45
46 // First pass to process 8 inputs.
47 {
48 int32_t* b = buffer;
49 const int8_t* i0 = input[0];
50 assert(i0 != NULL);
51 if XNN_UNPREDICTABLE(i0 != zero) {
52 i0 = (const int8_t*) ((uintptr_t) i0 + input_offset);
53 }
54 const int8_t* i1 = input[1];
55 assert(i1 != NULL);
56 if XNN_UNPREDICTABLE(i1 != zero) {
57 i1 = (const int8_t*) ((uintptr_t) i1 + input_offset);
58 }
59 const int8_t* i2 = input[2];
60 assert(i2 != NULL);
61 if XNN_UNPREDICTABLE(i2 != zero) {
62 i2 = (const int8_t*) ((uintptr_t) i2 + input_offset);
63 }
64 const int8_t* i3 = input[3];
65 assert(i3 != NULL);
66 if XNN_UNPREDICTABLE(i3 != zero) {
67 i3 = (const int8_t*) ((uintptr_t) i3 + input_offset);
68 }
69 const int8_t* i4 = input[4];
70 assert(i4 != NULL);
71 if XNN_UNPREDICTABLE(i4 != zero) {
72 i4 = (const int8_t*) ((uintptr_t) i4 + input_offset);
73 }
74 const int8_t* i5 = input[5];
75 assert(i5 != NULL);
76 if XNN_UNPREDICTABLE(i5 != zero) {
77 i5 = (const int8_t*) ((uintptr_t) i5 + input_offset);
78 }
79 const int8_t* i6 = input[6];
80 assert(i6 != NULL);
81 if XNN_UNPREDICTABLE(i6 != zero) {
82 i6 = (const int8_t*) ((uintptr_t) i6 + input_offset);
83 }
84 const int8_t* i7 = input[7];
85 assert(i7 != NULL);
86 if XNN_UNPREDICTABLE(i7 != zero) {
87 i7 = (const int8_t*) ((uintptr_t) i7 + input_offset);
88 }
89 input += 8;
90
91 size_t c = round_up_po2(channels, 8);
92
93 for (; c >= 8; c -= 8) {
94 int32x4_t vacc0123 = vld1q_s32(w); w = (const int32_t*) w + 4;
95 int32x4_t vacc4567 = vld1q_s32(w); w = (const int32_t*) w + 4;
96
97 const int8x8_t vi0x01234567 = vld1_s8(i0); i0 += 8;
98 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
99
100 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
101
102 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
103 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
104
105 const int8x8_t vi1x01234567 = vld1_s8(i1); i1 += 8;
106 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
107
108 vprod01234567 = vmull_s8(vi1x01234567, vk1x01234567);
109
110 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
111 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
112
113 const int8x8_t vi2x01234567 = vld1_s8(i2); i2 += 8;
114 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
115
116 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
117
118 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
119 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
120
121 const int8x8_t vi3x01234567 = vld1_s8(i3); i3 += 8;
122 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
123
124 vprod01234567 = vmull_s8(vi3x01234567, vk3x01234567);
125
126 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
127 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
128
129 const int8x8_t vi4x01234567 = vld1_s8(i4); i4 += 8;
130 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
131
132 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
133
134 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
135 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
136
137 const int8x8_t vi5x01234567 = vld1_s8(i5); i5 += 8;
138 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
139
140 vprod01234567 = vmull_s8(vi5x01234567, vk5x01234567);
141
142 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
143 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
144
145 const int8x8_t vi6x01234567 = vld1_s8(i6); i6 += 8;
146 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
147
148 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
149
150 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
151 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
152
153 const int8x8_t vi7x01234567 = vld1_s8(i7); i7 += 8;
154 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
155
156 vprod01234567 = vmull_s8(vi7x01234567, vk7x01234567);
157
158 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
159 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
160
161 vst1q_s32(b, vacc0123); b += 4;
162 vst1q_s32(b, vacc4567); b += 4;
163 }
164
165 assert(c == 0);
166 }
167
168 // Middle pass to process 8 inputs in each iteration.
169 for (size_t ks = kernel_size - 8; ks > 9; ks -= 8) {
170 int32_t* b = buffer;
171
172 const int8_t* i0 = input[0];
173 assert(i0 != NULL);
174 if XNN_UNPREDICTABLE(i0 != zero) {
175 i0 = (const int8_t*) ((uintptr_t) i0 + input_offset);
176 }
177 const int8_t* i1 = input[1];
178 assert(i1 != NULL);
179 if XNN_UNPREDICTABLE(i1 != zero) {
180 i1 = (const int8_t*) ((uintptr_t) i1 + input_offset);
181 }
182 const int8_t* i2 = input[2];
183 assert(i2 != NULL);
184 if XNN_UNPREDICTABLE(i2 != zero) {
185 i2 = (const int8_t*) ((uintptr_t) i2 + input_offset);
186 }
187 const int8_t* i3 = input[3];
188 assert(i3 != NULL);
189 if XNN_UNPREDICTABLE(i3 != zero) {
190 i3 = (const int8_t*) ((uintptr_t) i3 + input_offset);
191 }
192 const int8_t* i4 = input[4];
193 assert(i4 != NULL);
194 if XNN_UNPREDICTABLE(i4 != zero) {
195 i4 = (const int8_t*) ((uintptr_t) i4 + input_offset);
196 }
197 const int8_t* i5 = input[5];
198 assert(i5 != NULL);
199 if XNN_UNPREDICTABLE(i5 != zero) {
200 i5 = (const int8_t*) ((uintptr_t) i5 + input_offset);
201 }
202 const int8_t* i6 = input[6];
203 assert(i6 != NULL);
204 if XNN_UNPREDICTABLE(i6 != zero) {
205 i6 = (const int8_t*) ((uintptr_t) i6 + input_offset);
206 }
207 const int8_t* i7 = input[7];
208 assert(i7 != NULL);
209 if XNN_UNPREDICTABLE(i7 != zero) {
210 i7 = (const int8_t*) ((uintptr_t) i7 + input_offset);
211 }
212 input += 8;
213
214 size_t c = round_up_po2(channels, 8);
215
216 for (; c >= 8; c -= 8) {
217 int32x4_t vacc0123 = vld1q_s32(b);
218 int32x4_t vacc4567 = vld1q_s32(b + 4);
219
220 const int8x8_t vi0x01234567 = vld1_s8(i0); i0 += 8;
221 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
222
223 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
224
225 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
226 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
227
228 const int8x8_t vi1x01234567 = vld1_s8(i1); i1 += 8;
229 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
230
231 vprod01234567 = vmull_s8(vi1x01234567, vk1x01234567);
232
233 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
234 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
235
236 const int8x8_t vi2x01234567 = vld1_s8(i2); i2 += 8;
237 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
238
239 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
240
241 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
242 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
243
244 const int8x8_t vi3x01234567 = vld1_s8(i3); i3 += 8;
245 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
246
247 vprod01234567 = vmull_s8(vi3x01234567, vk3x01234567);
248
249 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
250 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
251
252 const int8x8_t vi4x01234567 = vld1_s8(i4); i4 += 8;
253 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
254
255 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
256
257 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
258 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
259
260 const int8x8_t vi5x01234567 = vld1_s8(i5); i5 += 8;
261 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
262
263 vprod01234567 = vmull_s8(vi5x01234567, vk5x01234567);
264
265 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
266 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
267
268 const int8x8_t vi6x01234567 = vld1_s8(i6); i6 += 8;
269 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
270
271 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
272
273 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
274 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
275
276 const int8x8_t vi7x01234567 = vld1_s8(i7); i7 += 8;
277 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
278
279 vprod01234567 = vmull_s8(vi7x01234567, vk7x01234567);
280
281 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
282 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
283
284 vst1q_s32(b, vacc0123); b += 4;
285 vst1q_s32(b, vacc4567); b += 4;
286 }
287
288 assert(c == 0);
289 }
290
291 // Last pass to process up to 9 inputs.
292 {
293 const int32_t* b = buffer;
294 const int8_t* i0 = input[0];
295 assert(i0 != NULL);
296 if XNN_UNPREDICTABLE(i0 != zero) {
297 i0 = (const int8_t*) ((uintptr_t) i0 + input_offset);
298 }
299 const int8_t* i1 = input[1];
300 assert(i1 != NULL);
301 if XNN_UNPREDICTABLE(i1 != zero) {
302 i1 = (const int8_t*) ((uintptr_t) i1 + input_offset);
303 }
304 const int8_t* i2 = input[2];
305 assert(i2 != NULL);
306 if XNN_UNPREDICTABLE(i2 != zero) {
307 i2 = (const int8_t*) ((uintptr_t) i2 + input_offset);
308 }
309 const int8_t* i3 = input[3];
310 assert(i3 != NULL);
311 if XNN_UNPREDICTABLE(i3 != zero) {
312 i3 = (const int8_t*) ((uintptr_t) i3 + input_offset);
313 }
314 const int8_t* i4 = input[4];
315 assert(i4 != NULL);
316 if XNN_UNPREDICTABLE(i4 != zero) {
317 i4 = (const int8_t*) ((uintptr_t) i4 + input_offset);
318 }
319 const int8_t* i5 = input[5];
320 assert(i5 != NULL);
321 if XNN_UNPREDICTABLE(i5 != zero) {
322 i5 = (const int8_t*) ((uintptr_t) i5 + input_offset);
323 }
324 const int8_t* i6 = input[6];
325 assert(i6 != NULL);
326 if XNN_UNPREDICTABLE(i6 != zero) {
327 i6 = (const int8_t*) ((uintptr_t) i6 + input_offset);
328 }
329 const int8_t* i7 = input[7];
330 assert(i7 != NULL);
331 if XNN_UNPREDICTABLE(i7 != zero) {
332 i7 = (const int8_t*) ((uintptr_t) i7 + input_offset);
333 }
334 const int8_t* i8 = input[8];
335 assert(i8 != NULL);
336 if XNN_UNPREDICTABLE(i8 != zero) {
337 i8 = (const int8_t*) ((uintptr_t) i8 + input_offset);
338 }
339
340 size_t c = channels;
341 for (; c >= 8; c -= 8) {
342 int32x4_t vacc0123 = vld1q_s32(b); b += 4;
343 int32x4_t vacc4567 = vld1q_s32(b); b += 4;
344
345 const int8x8_t vi0x01234567 = vld1_s8(i0); i0 += 8;
346 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
347
348 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
349
350 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
351 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
352
353 const int8x8_t vi1x01234567 = vld1_s8(i1); i1 += 8;
354 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
355
356 vprod01234567 = vmull_s8(vi1x01234567, vk1x01234567);
357
358 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
359 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
360
361 const int8x8_t vi2x01234567 = vld1_s8(i2); i2 += 8;
362 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
363
364 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
365
366 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
367 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
368
369 const int8x8_t vi3x01234567 = vld1_s8(i3); i3 += 8;
370 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
371
372 vprod01234567 = vmull_s8(vi3x01234567, vk3x01234567);
373
374 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
375 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
376
377 const int8x8_t vi4x01234567 = vld1_s8(i4); i4 += 8;
378 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
379
380 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
381
382 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
383 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
384
385 const int8x8_t vi5x01234567 = vld1_s8(i5); i5 += 8;
386 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
387
388 vprod01234567 = vmull_s8(vi5x01234567, vk5x01234567);
389
390 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
391 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
392
393 const int8x8_t vi6x01234567 = vld1_s8(i6); i6 += 8;
394 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
395
396 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
397
398 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
399 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
400
401 const int8x8_t vi7x01234567 = vld1_s8(i7); i7 += 8;
402 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
403
404 vprod01234567 = vmull_s8(vi7x01234567, vk7x01234567);
405
406 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
407 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
408
409 const int8x8_t vi8x01234567 = vld1_s8(i8); i8 += 8;
410 const int8x8_t vk8x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
411
412 vprod01234567 = vmull_s8(vi8x01234567, vk8x01234567);
413
414 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
415 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
416
417 vacc0123 = vqshlq_s32(vacc0123, vright_pre_shift);
418 vacc4567 = vqshlq_s32(vacc4567, vright_pre_shift);
419
420 vacc0123 = vqdmulhq_s32(vacc0123, vmultiplier);
421 vacc4567 = vqdmulhq_s32(vacc4567, vmultiplier);
422
423 vacc0123 = vrshlq_s32(vacc0123, vright_post_shift);
424 vacc4567 = vrshlq_s32(vacc4567, vright_post_shift);
425
426 #if XNN_ARCH_ARM64
427 int16x8_t vacc01234567 = vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567);
428
429 vacc01234567 = vqaddq_s16(vacc01234567, voutput_zero_point);
430
431 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
432 #else // !XNN_ARCH_ARM64
433 int16x8_t vacc01234567 = vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567));
434
435 vacc01234567 = vqaddq_s16(vacc01234567, voutput_zero_point);
436
437 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
438 #endif // !XNN_ARCH_ARM64
439
440 vout01234567 = vmax_s8(vout01234567, voutput_min);
441
442 vout01234567 = vmin_s8(vout01234567, voutput_max);
443
444 vst1_s8(output, vout01234567); output += 8;
445 }
446
447
448 if XNN_UNLIKELY(c != 0) {
449 {
450 int32x4_t vacc0123 = vld1q_s32(b); b += 4;
451 int32x4_t vacc4567 = vld1q_s32(b); b += 4;
452
453 const int8x8_t vi0x01234567 = vld1_s8(i0);
454 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
455
456 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
457
458 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
459 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
460 const int8x8_t vi1x01234567 = vld1_s8(i1);
461 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
462
463 vprod01234567 = vmull_s8(vi1x01234567, vk1x01234567);
464
465 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
466 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
467 const int8x8_t vi2x01234567 = vld1_s8(i2);
468 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
469
470 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
471
472 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
473 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
474 const int8x8_t vi3x01234567 = vld1_s8(i3);
475 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
476
477 vprod01234567 = vmull_s8(vi3x01234567, vk3x01234567);
478
479 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
480 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
481 const int8x8_t vi4x01234567 = vld1_s8(i4);
482 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
483
484 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
485
486 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
487 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
488 const int8x8_t vi5x01234567 = vld1_s8(i5);
489 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
490
491 vprod01234567 = vmull_s8(vi5x01234567, vk5x01234567);
492
493 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
494 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
495 const int8x8_t vi6x01234567 = vld1_s8(i6);
496 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
497
498 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
499
500 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
501 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
502 const int8x8_t vi7x01234567 = vld1_s8(i7);
503 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
504
505 vprod01234567 = vmull_s8(vi7x01234567, vk7x01234567);
506
507 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
508 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
509 const int8x8_t vi8x01234567 = vld1_s8(i8);
510 const int8x8_t vk8x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
511
512 vprod01234567 = vmull_s8(vi8x01234567, vk8x01234567);
513
514 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
515 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
516
517 vacc0123 = vqshlq_s32(vacc0123, vright_pre_shift);
518 vacc4567 = vqshlq_s32(vacc4567, vright_pre_shift);
519
520 vacc0123 = vqdmulhq_s32(vacc0123, vmultiplier);
521 vacc4567 = vqdmulhq_s32(vacc4567, vmultiplier);
522
523 vacc0123 = vrshlq_s32(vacc0123, vright_post_shift);
524 vacc4567 = vrshlq_s32(vacc4567, vright_post_shift);
525
526 #if XNN_ARCH_ARM64
527 int16x8_t vacc01234567 = vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567);
528 #else
529 int16x8_t vacc01234567 = vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567));
530 #endif
531 vacc01234567 = vqaddq_s16(vacc01234567, voutput_zero_point);
532
533 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
534 vout01234567 = vmax_s8(vout01234567, voutput_min);
535 vout01234567 = vmin_s8(vout01234567, voutput_max);
536
537 if (c & 4) {
538 vst1_lane_u32((void*) output, vreinterpret_u32_s8(vout01234567), 0); output += 4;
539 vout01234567 = vext_s8(vout01234567, vout01234567, 4);
540 }
541 if (c & 2) {
542 vst1_lane_u16((void*) output, vreinterpret_u16_s8(vout01234567), 0); output += 2;
543 vout01234567 = vext_s8(vout01234567, vout01234567, 2);
544 }
545 if (c & 1) {
546 vst1_lane_s8(output, vout01234567, 0); output += 1;
547 }
548
549 }
550 }
551 }
552
553 input = (const int8_t**) ((uintptr_t) input + input_stride);
554 output = (int8_t*) ((uintptr_t) output + output_increment);
555 } while (--output_width != 0);
556 }