Debian Codegraph @

src/qs8-dwconv/gen/qs8-dwconv-8f8m9l8c8s8r-minmax-rndnu-neon-mla8-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_mla8_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
103 const int8x8_t vi1x01234567 = vld1_s8(i1); i1 += 8;
104 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
105
106 vprod01234567 = vmlal_s8(vprod01234567, vi1x01234567, vk1x01234567);
107
108 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
109 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
110
111 const int8x8_t vi2x01234567 = vld1_s8(i2); i2 += 8;
112 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
113
114 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
115
116
117 const int8x8_t vi3x01234567 = vld1_s8(i3); i3 += 8;
118 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
119
120 vprod01234567 = vmlal_s8(vprod01234567, vi3x01234567, vk3x01234567);
121
122 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
123 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
124
125 const int8x8_t vi4x01234567 = vld1_s8(i4); i4 += 8;
126 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
127
128 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
129
130
131 const int8x8_t vi5x01234567 = vld1_s8(i5); i5 += 8;
132 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
133
134 vprod01234567 = vmlal_s8(vprod01234567, vi5x01234567, vk5x01234567);
135
136 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
137 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
138
139 const int8x8_t vi6x01234567 = vld1_s8(i6); i6 += 8;
140 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
141
142 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
143
144
145 const int8x8_t vi7x01234567 = vld1_s8(i7); i7 += 8;
146 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
147
148 vprod01234567 = vmlal_s8(vprod01234567, vi7x01234567, vk7x01234567);
149
150 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
151 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
152
153 vst1q_s32(b, vacc0123); b += 4;
154 vst1q_s32(b, vacc4567); b += 4;
155 }
156
157 assert(c == 0);
158 }
159
160 // Middle pass to process 8 inputs in each iteration.
161 for (size_t ks = kernel_size - 8; ks > 9; ks -= 8) {
162 int32_t* b = buffer;
163
164 const int8_t* i0 = input[0];
165 assert(i0 != NULL);
166 if XNN_UNPREDICTABLE(i0 != zero) {
167 i0 = (const int8_t*) ((uintptr_t) i0 + input_offset);
168 }
169 const int8_t* i1 = input[1];
170 assert(i1 != NULL);
171 if XNN_UNPREDICTABLE(i1 != zero) {
172 i1 = (const int8_t*) ((uintptr_t) i1 + input_offset);
173 }
174 const int8_t* i2 = input[2];
175 assert(i2 != NULL);
176 if XNN_UNPREDICTABLE(i2 != zero) {
177 i2 = (const int8_t*) ((uintptr_t) i2 + input_offset);
178 }
179 const int8_t* i3 = input[3];
180 assert(i3 != NULL);
181 if XNN_UNPREDICTABLE(i3 != zero) {
182 i3 = (const int8_t*) ((uintptr_t) i3 + input_offset);
183 }
184 const int8_t* i4 = input[4];
185 assert(i4 != NULL);
186 if XNN_UNPREDICTABLE(i4 != zero) {
187 i4 = (const int8_t*) ((uintptr_t) i4 + input_offset);
188 }
189 const int8_t* i5 = input[5];
190 assert(i5 != NULL);
191 if XNN_UNPREDICTABLE(i5 != zero) {
192 i5 = (const int8_t*) ((uintptr_t) i5 + input_offset);
193 }
194 const int8_t* i6 = input[6];
195 assert(i6 != NULL);
196 if XNN_UNPREDICTABLE(i6 != zero) {
197 i6 = (const int8_t*) ((uintptr_t) i6 + input_offset);
198 }
199 const int8_t* i7 = input[7];
200 assert(i7 != NULL);
201 if XNN_UNPREDICTABLE(i7 != zero) {
202 i7 = (const int8_t*) ((uintptr_t) i7 + input_offset);
203 }
204 input += 8;
205
206 size_t c = round_up_po2(channels, 8);
207
208 for (; c >= 8; c -= 8) {
209 int32x4_t vacc0123 = vld1q_s32(b);
210 int32x4_t vacc4567 = vld1q_s32(b + 4);
211
212 const int8x8_t vi0x01234567 = vld1_s8(i0); i0 += 8;
213 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
214
215 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
216
217
218 const int8x8_t vi1x01234567 = vld1_s8(i1); i1 += 8;
219 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
220
221 vprod01234567 = vmlal_s8(vprod01234567, vi1x01234567, vk1x01234567);
222
223 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
224 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
225
226 const int8x8_t vi2x01234567 = vld1_s8(i2); i2 += 8;
227 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
228
229 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
230
231
232 const int8x8_t vi3x01234567 = vld1_s8(i3); i3 += 8;
233 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
234
235 vprod01234567 = vmlal_s8(vprod01234567, vi3x01234567, vk3x01234567);
236
237 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
238 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
239
240 const int8x8_t vi4x01234567 = vld1_s8(i4); i4 += 8;
241 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
242
243 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
244
245
246 const int8x8_t vi5x01234567 = vld1_s8(i5); i5 += 8;
247 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
248
249 vprod01234567 = vmlal_s8(vprod01234567, vi5x01234567, vk5x01234567);
250
251 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
252 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
253
254 const int8x8_t vi6x01234567 = vld1_s8(i6); i6 += 8;
255 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
256
257 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
258
259
260 const int8x8_t vi7x01234567 = vld1_s8(i7); i7 += 8;
261 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
262
263 vprod01234567 = vmlal_s8(vprod01234567, vi7x01234567, vk7x01234567);
264
265 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
266 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
267
268 vst1q_s32(b, vacc0123); b += 4;
269 vst1q_s32(b, vacc4567); b += 4;
270 }
271
272 assert(c == 0);
273 }
274
275 // Last pass to process up to 9 inputs.
276 {
277 const int32_t* b = buffer;
278 const int8_t* i0 = input[0];
279 assert(i0 != NULL);
280 if XNN_UNPREDICTABLE(i0 != zero) {
281 i0 = (const int8_t*) ((uintptr_t) i0 + input_offset);
282 }
283 const int8_t* i1 = input[1];
284 assert(i1 != NULL);
285 if XNN_UNPREDICTABLE(i1 != zero) {
286 i1 = (const int8_t*) ((uintptr_t) i1 + input_offset);
287 }
288 const int8_t* i2 = input[2];
289 assert(i2 != NULL);
290 if XNN_UNPREDICTABLE(i2 != zero) {
291 i2 = (const int8_t*) ((uintptr_t) i2 + input_offset);
292 }
293 const int8_t* i3 = input[3];
294 assert(i3 != NULL);
295 if XNN_UNPREDICTABLE(i3 != zero) {
296 i3 = (const int8_t*) ((uintptr_t) i3 + input_offset);
297 }
298 const int8_t* i4 = input[4];
299 assert(i4 != NULL);
300 if XNN_UNPREDICTABLE(i4 != zero) {
301 i4 = (const int8_t*) ((uintptr_t) i4 + input_offset);
302 }
303 const int8_t* i5 = input[5];
304 assert(i5 != NULL);
305 if XNN_UNPREDICTABLE(i5 != zero) {
306 i5 = (const int8_t*) ((uintptr_t) i5 + input_offset);
307 }
308 const int8_t* i6 = input[6];
309 assert(i6 != NULL);
310 if XNN_UNPREDICTABLE(i6 != zero) {
311 i6 = (const int8_t*) ((uintptr_t) i6 + input_offset);
312 }
313 const int8_t* i7 = input[7];
314 assert(i7 != NULL);
315 if XNN_UNPREDICTABLE(i7 != zero) {
316 i7 = (const int8_t*) ((uintptr_t) i7 + input_offset);
317 }
318 const int8_t* i8 = input[8];
319 assert(i8 != NULL);
320 if XNN_UNPREDICTABLE(i8 != zero) {
321 i8 = (const int8_t*) ((uintptr_t) i8 + input_offset);
322 }
323
324 size_t c = channels;
325 for (; c >= 8; c -= 8) {
326 int32x4_t vacc0123 = vld1q_s32(b); b += 4;
327 int32x4_t vacc4567 = vld1q_s32(b); b += 4;
328
329 const int8x8_t vi0x01234567 = vld1_s8(i0); i0 += 8;
330 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
331
332 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
333
334
335 const int8x8_t vi1x01234567 = vld1_s8(i1); i1 += 8;
336 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
337
338 vprod01234567 = vmlal_s8(vprod01234567, vi1x01234567, vk1x01234567);
339
340 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
341 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
342
343 const int8x8_t vi2x01234567 = vld1_s8(i2); i2 += 8;
344 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
345
346 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
347
348
349 const int8x8_t vi3x01234567 = vld1_s8(i3); i3 += 8;
350 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
351
352 vprod01234567 = vmlal_s8(vprod01234567, vi3x01234567, vk3x01234567);
353
354 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
355 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
356
357 const int8x8_t vi4x01234567 = vld1_s8(i4); i4 += 8;
358 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
359
360 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
361
362
363 const int8x8_t vi5x01234567 = vld1_s8(i5); i5 += 8;
364 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
365
366 vprod01234567 = vmlal_s8(vprod01234567, vi5x01234567, vk5x01234567);
367
368 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
369 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
370
371 const int8x8_t vi6x01234567 = vld1_s8(i6); i6 += 8;
372 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
373
374 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
375
376
377 const int8x8_t vi7x01234567 = vld1_s8(i7); i7 += 8;
378 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
379
380 vprod01234567 = vmlal_s8(vprod01234567, vi7x01234567, vk7x01234567);
381
382 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
383 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
384
385 const int8x8_t vi8x01234567 = vld1_s8(i8); i8 += 8;
386 const int8x8_t vk8x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
387
388 vprod01234567 = vmull_s8(vi8x01234567, vk8x01234567);
389
390 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
391 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
392
393 vacc0123 = vqshlq_s32(vacc0123, vright_pre_shift);
394 vacc4567 = vqshlq_s32(vacc4567, vright_pre_shift);
395
396 vacc0123 = vqdmulhq_s32(vacc0123, vmultiplier);
397 vacc4567 = vqdmulhq_s32(vacc4567, vmultiplier);
398
399 vacc0123 = vrshlq_s32(vacc0123, vright_post_shift);
400 vacc4567 = vrshlq_s32(vacc4567, vright_post_shift);
401
402 #if XNN_ARCH_ARM64
403 int16x8_t vacc01234567 = vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567);
404
405 vacc01234567 = vqaddq_s16(vacc01234567, voutput_zero_point);
406
407 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
408 #else // !XNN_ARCH_ARM64
409 int16x8_t vacc01234567 = vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567));
410
411 vacc01234567 = vqaddq_s16(vacc01234567, voutput_zero_point);
412
413 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
414 #endif // !XNN_ARCH_ARM64
415
416 vout01234567 = vmax_s8(vout01234567, voutput_min);
417
418 vout01234567 = vmin_s8(vout01234567, voutput_max);
419
420 vst1_s8(output, vout01234567); output += 8;
421 }
422
423
424 if XNN_UNLIKELY(c != 0) {
425 {
426 int32x4_t vacc0123 = vld1q_s32(b); b += 4;
427 int32x4_t vacc4567 = vld1q_s32(b); b += 4;
428
429 const int8x8_t vi0x01234567 = vld1_s8(i0);
430 const int8x8_t vk0x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
431
432 int16x8_t vprod01234567 = vmull_s8(vi0x01234567, vk0x01234567);
433
434 const int8x8_t vi1x01234567 = vld1_s8(i1);
435 const int8x8_t vk1x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
436
437 vprod01234567 = vmlal_s8(vprod01234567, vi1x01234567, vk1x01234567);
438
439 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
440 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
441 const int8x8_t vi2x01234567 = vld1_s8(i2);
442 const int8x8_t vk2x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
443
444 vprod01234567 = vmull_s8(vi2x01234567, vk2x01234567);
445
446 const int8x8_t vi3x01234567 = vld1_s8(i3);
447 const int8x8_t vk3x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
448
449 vprod01234567 = vmlal_s8(vprod01234567, vi3x01234567, vk3x01234567);
450
451 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
452 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
453 const int8x8_t vi4x01234567 = vld1_s8(i4);
454 const int8x8_t vk4x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
455
456 vprod01234567 = vmull_s8(vi4x01234567, vk4x01234567);
457
458 const int8x8_t vi5x01234567 = vld1_s8(i5);
459 const int8x8_t vk5x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
460
461 vprod01234567 = vmlal_s8(vprod01234567, vi5x01234567, vk5x01234567);
462
463 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
464 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
465 const int8x8_t vi6x01234567 = vld1_s8(i6);
466 const int8x8_t vk6x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
467
468 vprod01234567 = vmull_s8(vi6x01234567, vk6x01234567);
469
470 const int8x8_t vi7x01234567 = vld1_s8(i7);
471 const int8x8_t vk7x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
472
473 vprod01234567 = vmlal_s8(vprod01234567, vi7x01234567, vk7x01234567);
474
475 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
476 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
477 const int8x8_t vi8x01234567 = vld1_s8(i8);
478 const int8x8_t vk8x01234567 = vld1_s8(w); w = (const int8_t*) w + 8;
479
480 vprod01234567 = vmull_s8(vi8x01234567, vk8x01234567);
481
482 vacc0123 = vaddw_s16(vacc0123, vget_low_s16(vprod01234567));
483 vacc4567 = vaddw_s16(vacc4567, vget_high_s16(vprod01234567));
484
485 vacc0123 = vqshlq_s32(vacc0123, vright_pre_shift);
486 vacc4567 = vqshlq_s32(vacc4567, vright_pre_shift);
487
488 vacc0123 = vqdmulhq_s32(vacc0123, vmultiplier);
489 vacc4567 = vqdmulhq_s32(vacc4567, vmultiplier);
490
491 vacc0123 = vrshlq_s32(vacc0123, vright_post_shift);
492 vacc4567 = vrshlq_s32(vacc4567, vright_post_shift);
493
494 #if XNN_ARCH_ARM64
495 int16x8_t vacc01234567 = vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567);
496 #else
497 int16x8_t vacc01234567 = vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567));
498 #endif
499 vacc01234567 = vqaddq_s16(vacc01234567, voutput_zero_point);
500
501 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
502 vout01234567 = vmax_s8(vout01234567, voutput_min);
503 vout01234567 = vmin_s8(vout01234567, voutput_max);
504
505 if (c & 4) {
506 vst1_lane_u32((void*) output, vreinterpret_u32_s8(vout01234567), 0); output += 4;
507 vout01234567 = vext_s8(vout01234567, vout01234567, 4);
508 }
509 if (c & 2) {
510 vst1_lane_u16((void*) output, vreinterpret_u16_s8(vout01234567), 0); output += 2;
511 vout01234567 = vext_s8(vout01234567, vout01234567, 2);
512 }
513 if (c & 1) {
514 vst1_lane_s8(output, vout01234567, 0); output += 1;
515 }
516
517 }
518 }
519 }
520
521 input = (const int8_t**) ((uintptr_t) input + input_stride);
522 output = (int8_t*) ((uintptr_t) output + output_increment);
523 } while (--output_width != 0);
524 }