xref: /aosp_15_r20/external/XNNPACK/src/qs8-gemm/gen/4x16c2-minmax-rndnu-neon-mull-ld2r.c (revision 4bdc94577ba0e567308109d787f7fec7b531ce36)
1 // Auto-generated file. Do not edit!
2 //   Template: src/qs8-gemm/c2-neon-mull-dup.c.in
3 //   Generator: tools/xngen
4 //
5 // Copyright 2021 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 #include <assert.h>
11 
12 #include <arm_neon.h>
13 
14 #include <xnnpack/gemm.h>
15 #include <xnnpack/math.h>
16 
xnn_qs8_gemm_minmax_rndnu_ukernel_4x16c2__neon_mull_ld2r(size_t mr,size_t nc,size_t kc,const int8_t * restrict a,size_t a_stride,const void * restrict w,int8_t * restrict c,size_t cm_stride,size_t cn_stride,const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS (1)])17 void xnn_qs8_gemm_minmax_rndnu_ukernel_4x16c2__neon_mull_ld2r(
18     size_t mr,
19     size_t nc,
20     size_t kc,
21     const int8_t* restrict a,
22     size_t a_stride,
23     const void* restrict w,
24     int8_t* restrict c,
25     size_t cm_stride,
26     size_t cn_stride,
27     const union xnn_qs8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
28 {
29   assert(mr != 0);
30   assert(mr <= 4);
31   assert(nc != 0);
32   assert(kc != 0);
33   assert(kc % sizeof(int8_t) == 0);
34   assert(a != NULL);
35   assert(w != NULL);
36   assert(c != NULL);
37 
38   kc = round_up_po2(kc, 2 * sizeof(int8_t));
39   const int8_t* a0 = a;
40   int8_t* c0 = c;
41   const int8_t* a1 = (const int8_t*) ((uintptr_t) a0 + a_stride);
42   int8_t* c1 = (int8_t*) ((uintptr_t) c0 + cm_stride);
43   if XNN_UNPREDICTABLE(mr < 2) {
44     a1 = a0;
45     c1 = c0;
46   }
47   const int8_t* a2 = (const int8_t*) ((uintptr_t) a1 + a_stride);
48   int8_t* c2 = (int8_t*) ((uintptr_t) c1 + cm_stride);
49   if XNN_UNPREDICTABLE(mr <= 2) {
50     a2 = a1;
51     c2 = c1;
52   }
53   const int8_t* a3 = (const int8_t*) ((uintptr_t) a2 + a_stride);
54   int8_t* c3 = (int8_t*) ((uintptr_t) c2 + cm_stride);
55   if XNN_UNPREDICTABLE(mr != 4) {
56     a3 = a2;
57     c3 = c2;
58   }
59 
60   do {
61     int32x4_t vacc0x0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
62     int32x4_t vacc0x4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
63     int32x4_t vacc0x89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
64     int32x4_t vacc0xCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
65     int32x4_t vacc1x0123 = vacc0x0123;
66     int32x4_t vacc1x4567 = vacc0x4567;
67     int32x4_t vacc1x89AB = vacc0x89AB;
68     int32x4_t vacc1xCDEF = vacc0xCDEF;
69     int32x4_t vacc2x0123 = vacc0x0123;
70     int32x4_t vacc2x4567 = vacc0x4567;
71     int32x4_t vacc2x89AB = vacc0x89AB;
72     int32x4_t vacc2xCDEF = vacc0xCDEF;
73     int32x4_t vacc3x0123 = vacc0x0123;
74     int32x4_t vacc3x4567 = vacc0x4567;
75     int32x4_t vacc3x89AB = vacc0x89AB;
76     int32x4_t vacc3xCDEF = vacc0xCDEF;
77 
78     size_t k = kc;
79 
80 
81     while (k >= 8 * sizeof(int8_t)) {
82       const int16x4x2_t va00 = vld2_dup_s16((const void*)a0);
83       const int16x4x2_t va01 = vld2_dup_s16((const void*)(a0 + 4)); a0 += 8;
84       const int16x4x2_t va10 = vld2_dup_s16((const void*)a1);
85       const int16x4x2_t va11 = vld2_dup_s16((const void*)(a1 + 4)); a1 += 8;
86       const int16x4x2_t va20 = vld2_dup_s16((const void*)a2);
87       const int16x4x2_t va21 = vld2_dup_s16((const void*)(a2 + 4)); a2 += 8;
88       const int16x4x2_t va30 = vld2_dup_s16((const void*)a3);
89       const int16x4x2_t va31 = vld2_dup_s16((const void*)(a3 + 4)); a3 += 8;
90 
91       const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
92       const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
93       const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
94       const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
95       const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
96       const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
97       const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
98       const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
99       const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
100       const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
101       const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
102       const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
103       const int8x8_t vb0123c3 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
104       const int8x8_t vb4567c3 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
105       const int8x8_t vb89ABc3 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
106       const int8x8_t vbCDEFc3 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
107 
108       const int8x8_t va0c0 = vreinterpret_s8_s16(va00.val[0]);
109       const int8x8_t va1c0 = vreinterpret_s8_s16(va10.val[0]);
110       const int8x8_t va2c0 = vreinterpret_s8_s16(va20.val[0]);
111       const int8x8_t va3c0 = vreinterpret_s8_s16(va30.val[0]);
112 
113       const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, va0c0);
114       const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, va1c0);
115       const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, va2c0);
116       const int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0, va3c0);
117       vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
118       vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
119       vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
120       vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
121       const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, va0c0);
122       const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, va1c0);
123       const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, va2c0);
124       const int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0, va3c0);
125       vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
126       vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
127       vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
128       vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
129       const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, va0c0);
130       const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, va1c0);
131       const int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0, va2c0);
132       const int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0, va3c0);
133       vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
134       vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
135       vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
136       vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
137       const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, va0c0);
138       const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, va1c0);
139       const int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0, va2c0);
140       const int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0, va3c0);
141       vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
142       vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
143       vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
144       vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
145       const int8x8_t va0c1 = vreinterpret_s8_s16(va00.val[1]);
146       const int8x8_t va1c1 = vreinterpret_s8_s16(va10.val[1]);
147       const int8x8_t va2c1 = vreinterpret_s8_s16(va20.val[1]);
148       const int8x8_t va3c1 = vreinterpret_s8_s16(va30.val[1]);
149 
150       const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, va0c1);
151       const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, va1c1);
152       const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, va2c1);
153       const int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1, va3c1);
154       vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
155       vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
156       vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
157       vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
158       const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, va0c1);
159       const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, va1c1);
160       const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, va2c1);
161       const int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1, va3c1);
162       vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
163       vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
164       vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
165       vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
166       const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, va0c1);
167       const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, va1c1);
168       const int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1, va2c1);
169       const int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1, va3c1);
170       vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
171       vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
172       vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
173       vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
174       const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, va0c1);
175       const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, va1c1);
176       const int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1, va2c1);
177       const int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1, va3c1);
178       vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
179       vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
180       vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
181       vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
182       const int8x8_t va0c2 = vreinterpret_s8_s16(va01.val[0]);
183       const int8x8_t va1c2 = vreinterpret_s8_s16(va11.val[0]);
184       const int8x8_t va2c2 = vreinterpret_s8_s16(va21.val[0]);
185       const int8x8_t va3c2 = vreinterpret_s8_s16(va31.val[0]);
186 
187       const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, va0c2);
188       const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, va1c2);
189       const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, va2c2);
190       const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, va3c2);
191       vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
192       vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
193       vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
194       vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
195       const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, va0c2);
196       const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, va1c2);
197       const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, va2c2);
198       const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, va3c2);
199       vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
200       vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
201       vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
202       vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
203       const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, va0c2);
204       const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, va1c2);
205       const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, va2c2);
206       const int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2, va3c2);
207       vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
208       vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
209       vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
210       vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
211       const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, va0c2);
212       const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, va1c2);
213       const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, va2c2);
214       const int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2, va3c2);
215       vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
216       vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
217       vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
218       vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
219       const int8x8_t va0c3 = vreinterpret_s8_s16(va01.val[1]);
220       const int8x8_t va1c3 = vreinterpret_s8_s16(va11.val[1]);
221       const int8x8_t va2c3 = vreinterpret_s8_s16(va21.val[1]);
222       const int8x8_t va3c3 = vreinterpret_s8_s16(va31.val[1]);
223 
224       const int16x8_t vprod0x0123c3 = vmull_s8(vb0123c3, va0c3);
225       const int16x8_t vprod1x0123c3 = vmull_s8(vb0123c3, va1c3);
226       const int16x8_t vprod2x0123c3 = vmull_s8(vb0123c3, va2c3);
227       const int16x8_t vprod3x0123c3 = vmull_s8(vb0123c3, va3c3);
228       vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c3);
229       vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c3);
230       vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c3);
231       vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c3);
232       const int16x8_t vprod0x4567c3 = vmull_s8(vb4567c3, va0c3);
233       const int16x8_t vprod1x4567c3 = vmull_s8(vb4567c3, va1c3);
234       const int16x8_t vprod2x4567c3 = vmull_s8(vb4567c3, va2c3);
235       const int16x8_t vprod3x4567c3 = vmull_s8(vb4567c3, va3c3);
236       vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c3);
237       vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c3);
238       vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c3);
239       vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c3);
240       const int16x8_t vprod0x89ABc3 = vmull_s8(vb89ABc3, va0c3);
241       const int16x8_t vprod1x89ABc3 = vmull_s8(vb89ABc3, va1c3);
242       const int16x8_t vprod2x89ABc3 = vmull_s8(vb89ABc3, va2c3);
243       const int16x8_t vprod3x89ABc3 = vmull_s8(vb89ABc3, va3c3);
244       vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc3);
245       vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc3);
246       vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc3);
247       vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc3);
248       const int16x8_t vprod0xCDEFc3 = vmull_s8(vbCDEFc3, va0c3);
249       const int16x8_t vprod1xCDEFc3 = vmull_s8(vbCDEFc3, va1c3);
250       const int16x8_t vprod2xCDEFc3 = vmull_s8(vbCDEFc3, va2c3);
251       const int16x8_t vprod3xCDEFc3 = vmull_s8(vbCDEFc3, va3c3);
252       vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc3);
253       vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc3);
254       vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc3);
255       vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc3);
256 
257       k -= 8 * sizeof(int8_t);
258     }
259 
260     if XNN_UNLIKELY(k != 0) {
261       const int8x8_t va0 = vld1_s8(a0); a0 = (const int8_t*) ((uintptr_t) a0 + k);
262       const int8x8_t va1 = vld1_s8(a1); a1 = (const int8_t*) ((uintptr_t) a1 + k);
263       const int8x8_t va2 = vld1_s8(a2); a2 = (const int8_t*) ((uintptr_t) a2 + k);
264       const int8x8_t va3 = vld1_s8(a3); a3 = (const int8_t*) ((uintptr_t) a3 + k);
265 
266       const int8x8_t vb0123c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
267       const int8x8_t vb4567c0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
268       const int8x8_t vb89ABc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
269       const int8x8_t vbCDEFc0 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
270 
271       const int8x8_t va0c0 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 0));
272       const int16x8_t vprod0x0123c0 = vmull_s8(vb0123c0, va0c0);
273       vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c0);
274       const int16x8_t vprod0x4567c0 = vmull_s8(vb4567c0, va0c0);
275       vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c0);
276       const int16x8_t vprod0x89ABc0 = vmull_s8(vb89ABc0, va0c0);
277       vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc0);
278       const int16x8_t vprod0xCDEFc0 = vmull_s8(vbCDEFc0, va0c0);
279       vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc0);
280       const int8x8_t va1c0 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 0));
281       const int16x8_t vprod1x0123c0 = vmull_s8(vb0123c0, va1c0);
282       vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c0);
283       const int16x8_t vprod1x4567c0 = vmull_s8(vb4567c0, va1c0);
284       vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c0);
285       const int16x8_t vprod1x89ABc0 = vmull_s8(vb89ABc0, va1c0);
286       vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc0);
287       const int16x8_t vprod1xCDEFc0 = vmull_s8(vbCDEFc0, va1c0);
288       vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc0);
289       const int8x8_t va2c0 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 0));
290       const int16x8_t vprod2x0123c0 = vmull_s8(vb0123c0, va2c0);
291       vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c0);
292       const int16x8_t vprod2x4567c0 = vmull_s8(vb4567c0, va2c0);
293       vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c0);
294       const int16x8_t vprod2x89ABc0 = vmull_s8(vb89ABc0, va2c0);
295       vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc0);
296       const int16x8_t vprod2xCDEFc0 = vmull_s8(vbCDEFc0, va2c0);
297       vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc0);
298       const int8x8_t va3c0 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 0));
299       const int16x8_t vprod3x0123c0 = vmull_s8(vb0123c0, va3c0);
300       vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c0);
301       const int16x8_t vprod3x4567c0 = vmull_s8(vb4567c0, va3c0);
302       vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c0);
303       const int16x8_t vprod3x89ABc0 = vmull_s8(vb89ABc0, va3c0);
304       vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc0);
305       const int16x8_t vprod3xCDEFc0 = vmull_s8(vbCDEFc0, va3c0);
306       vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc0);
307 
308       if (k > 2 * sizeof(int8_t)) {
309         const int8x8_t vb0123c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
310         const int8x8_t vb4567c1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
311         const int8x8_t vb89ABc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
312         const int8x8_t vbCDEFc1 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
313 
314         const int8x8_t va0c1 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 1));
315         const int16x8_t vprod0x0123c1 = vmull_s8(vb0123c1, va0c1);
316         vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c1);
317         const int16x8_t vprod0x4567c1 = vmull_s8(vb4567c1, va0c1);
318         vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c1);
319         const int16x8_t vprod0x89ABc1 = vmull_s8(vb89ABc1, va0c1);
320         vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc1);
321         const int16x8_t vprod0xCDEFc1 = vmull_s8(vbCDEFc1, va0c1);
322         vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc1);
323         const int8x8_t va1c1 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 1));
324         const int16x8_t vprod1x0123c1 = vmull_s8(vb0123c1, va1c1);
325         vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c1);
326         const int16x8_t vprod1x4567c1 = vmull_s8(vb4567c1, va1c1);
327         vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c1);
328         const int16x8_t vprod1x89ABc1 = vmull_s8(vb89ABc1, va1c1);
329         vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc1);
330         const int16x8_t vprod1xCDEFc1 = vmull_s8(vbCDEFc1, va1c1);
331         vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc1);
332         const int8x8_t va2c1 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 1));
333         const int16x8_t vprod2x0123c1 = vmull_s8(vb0123c1, va2c1);
334         vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c1);
335         const int16x8_t vprod2x4567c1 = vmull_s8(vb4567c1, va2c1);
336         vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c1);
337         const int16x8_t vprod2x89ABc1 = vmull_s8(vb89ABc1, va2c1);
338         vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc1);
339         const int16x8_t vprod2xCDEFc1 = vmull_s8(vbCDEFc1, va2c1);
340         vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc1);
341         const int8x8_t va3c1 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 1));
342         const int16x8_t vprod3x0123c1 = vmull_s8(vb0123c1, va3c1);
343         vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c1);
344         const int16x8_t vprod3x4567c1 = vmull_s8(vb4567c1, va3c1);
345         vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c1);
346         const int16x8_t vprod3x89ABc1 = vmull_s8(vb89ABc1, va3c1);
347         vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc1);
348         const int16x8_t vprod3xCDEFc1 = vmull_s8(vbCDEFc1, va3c1);
349         vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc1);
350 
351         if (k > 4 * sizeof(int8_t)) {
352           const int8x8_t vb0123c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
353           const int8x8_t vb4567c2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
354           const int8x8_t vb89ABc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
355           const int8x8_t vbCDEFc2 = vld1_s8(w); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
356 
357           const int8x8_t va0c2 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va0), 2));
358           const int16x8_t vprod0x0123c2 = vmull_s8(vb0123c2, va0c2);
359           vacc0x0123 = vpadalq_s16(vacc0x0123, vprod0x0123c2);
360           const int16x8_t vprod0x4567c2 = vmull_s8(vb4567c2, va0c2);
361           vacc0x4567 = vpadalq_s16(vacc0x4567, vprod0x4567c2);
362           const int16x8_t vprod0x89ABc2 = vmull_s8(vb89ABc2, va0c2);
363           vacc0x89AB = vpadalq_s16(vacc0x89AB, vprod0x89ABc2);
364           const int16x8_t vprod0xCDEFc2 = vmull_s8(vbCDEFc2, va0c2);
365           vacc0xCDEF = vpadalq_s16(vacc0xCDEF, vprod0xCDEFc2);
366           const int8x8_t va1c2 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va1), 2));
367           const int16x8_t vprod1x0123c2 = vmull_s8(vb0123c2, va1c2);
368           vacc1x0123 = vpadalq_s16(vacc1x0123, vprod1x0123c2);
369           const int16x8_t vprod1x4567c2 = vmull_s8(vb4567c2, va1c2);
370           vacc1x4567 = vpadalq_s16(vacc1x4567, vprod1x4567c2);
371           const int16x8_t vprod1x89ABc2 = vmull_s8(vb89ABc2, va1c2);
372           vacc1x89AB = vpadalq_s16(vacc1x89AB, vprod1x89ABc2);
373           const int16x8_t vprod1xCDEFc2 = vmull_s8(vbCDEFc2, va1c2);
374           vacc1xCDEF = vpadalq_s16(vacc1xCDEF, vprod1xCDEFc2);
375           const int8x8_t va2c2 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va2), 2));
376           const int16x8_t vprod2x0123c2 = vmull_s8(vb0123c2, va2c2);
377           vacc2x0123 = vpadalq_s16(vacc2x0123, vprod2x0123c2);
378           const int16x8_t vprod2x4567c2 = vmull_s8(vb4567c2, va2c2);
379           vacc2x4567 = vpadalq_s16(vacc2x4567, vprod2x4567c2);
380           const int16x8_t vprod2x89ABc2 = vmull_s8(vb89ABc2, va2c2);
381           vacc2x89AB = vpadalq_s16(vacc2x89AB, vprod2x89ABc2);
382           const int16x8_t vprod2xCDEFc2 = vmull_s8(vbCDEFc2, va2c2);
383           vacc2xCDEF = vpadalq_s16(vacc2xCDEF, vprod2xCDEFc2);
384           const int8x8_t va3c2 = vreinterpret_s8_s16(vdup_lane_s16(vreinterpret_s16_s8(va3), 2));
385           const int16x8_t vprod3x0123c2 = vmull_s8(vb0123c2, va3c2);
386           vacc3x0123 = vpadalq_s16(vacc3x0123, vprod3x0123c2);
387           const int16x8_t vprod3x4567c2 = vmull_s8(vb4567c2, va3c2);
388           vacc3x4567 = vpadalq_s16(vacc3x4567, vprod3x4567c2);
389           const int16x8_t vprod3x89ABc2 = vmull_s8(vb89ABc2, va3c2);
390           vacc3x89AB = vpadalq_s16(vacc3x89AB, vprod3x89ABc2);
391           const int16x8_t vprod3xCDEFc2 = vmull_s8(vbCDEFc2, va3c2);
392           vacc3xCDEF = vpadalq_s16(vacc3xCDEF, vprod3xCDEFc2);
393         }
394       }
395     }
396 
397     const int32x4_t vright_pre_shift = vld1q_dup_s32(&params->rndnu_neon.right_pre_shift);
398     const int32x4_t vmultiplier = vld1q_dup_s32(&params->rndnu_neon.multiplier);
399     const int32x4_t vright_post_shift = vld1q_dup_s32(&params->rndnu_neon.right_post_shift);
400 
401     vacc0x0123 = vqshlq_s32(vacc0x0123, vright_pre_shift);
402     vacc0x4567 = vqshlq_s32(vacc0x4567, vright_pre_shift);
403     vacc0x89AB = vqshlq_s32(vacc0x89AB, vright_pre_shift);
404     vacc0xCDEF = vqshlq_s32(vacc0xCDEF, vright_pre_shift);
405     vacc1x0123 = vqshlq_s32(vacc1x0123, vright_pre_shift);
406     vacc1x4567 = vqshlq_s32(vacc1x4567, vright_pre_shift);
407     vacc1x89AB = vqshlq_s32(vacc1x89AB, vright_pre_shift);
408     vacc1xCDEF = vqshlq_s32(vacc1xCDEF, vright_pre_shift);
409     vacc2x0123 = vqshlq_s32(vacc2x0123, vright_pre_shift);
410     vacc2x4567 = vqshlq_s32(vacc2x4567, vright_pre_shift);
411     vacc2x89AB = vqshlq_s32(vacc2x89AB, vright_pre_shift);
412     vacc2xCDEF = vqshlq_s32(vacc2xCDEF, vright_pre_shift);
413     vacc3x0123 = vqshlq_s32(vacc3x0123, vright_pre_shift);
414     vacc3x4567 = vqshlq_s32(vacc3x4567, vright_pre_shift);
415     vacc3x89AB = vqshlq_s32(vacc3x89AB, vright_pre_shift);
416     vacc3xCDEF = vqshlq_s32(vacc3xCDEF, vright_pre_shift);
417 
418     vacc0x0123 = vqdmulhq_s32(vacc0x0123, vmultiplier);
419     vacc0x4567 = vqdmulhq_s32(vacc0x4567, vmultiplier);
420     vacc0x89AB = vqdmulhq_s32(vacc0x89AB, vmultiplier);
421     vacc0xCDEF = vqdmulhq_s32(vacc0xCDEF, vmultiplier);
422     vacc1x0123 = vqdmulhq_s32(vacc1x0123, vmultiplier);
423     vacc1x4567 = vqdmulhq_s32(vacc1x4567, vmultiplier);
424     vacc1x89AB = vqdmulhq_s32(vacc1x89AB, vmultiplier);
425     vacc1xCDEF = vqdmulhq_s32(vacc1xCDEF, vmultiplier);
426     vacc2x0123 = vqdmulhq_s32(vacc2x0123, vmultiplier);
427     vacc2x4567 = vqdmulhq_s32(vacc2x4567, vmultiplier);
428     vacc2x89AB = vqdmulhq_s32(vacc2x89AB, vmultiplier);
429     vacc2xCDEF = vqdmulhq_s32(vacc2xCDEF, vmultiplier);
430     vacc3x0123 = vqdmulhq_s32(vacc3x0123, vmultiplier);
431     vacc3x4567 = vqdmulhq_s32(vacc3x4567, vmultiplier);
432     vacc3x89AB = vqdmulhq_s32(vacc3x89AB, vmultiplier);
433     vacc3xCDEF = vqdmulhq_s32(vacc3xCDEF, vmultiplier);
434 
435     vacc0x0123 = vrshlq_s32(vacc0x0123, vright_post_shift);
436     vacc0x4567 = vrshlq_s32(vacc0x4567, vright_post_shift);
437     vacc0x89AB = vrshlq_s32(vacc0x89AB, vright_post_shift);
438     vacc0xCDEF = vrshlq_s32(vacc0xCDEF, vright_post_shift);
439     vacc1x0123 = vrshlq_s32(vacc1x0123, vright_post_shift);
440     vacc1x4567 = vrshlq_s32(vacc1x4567, vright_post_shift);
441     vacc1x89AB = vrshlq_s32(vacc1x89AB, vright_post_shift);
442     vacc1xCDEF = vrshlq_s32(vacc1xCDEF, vright_post_shift);
443     vacc2x0123 = vrshlq_s32(vacc2x0123, vright_post_shift);
444     vacc2x4567 = vrshlq_s32(vacc2x4567, vright_post_shift);
445     vacc2x89AB = vrshlq_s32(vacc2x89AB, vright_post_shift);
446     vacc2xCDEF = vrshlq_s32(vacc2xCDEF, vright_post_shift);
447     vacc3x0123 = vrshlq_s32(vacc3x0123, vright_post_shift);
448     vacc3x4567 = vrshlq_s32(vacc3x4567, vright_post_shift);
449     vacc3x89AB = vrshlq_s32(vacc3x89AB, vright_post_shift);
450     vacc3xCDEF = vrshlq_s32(vacc3xCDEF, vright_post_shift);
451 
452     const int16x8_t voutput_zero_point = vld1q_dup_s16(&params->rndnu_neon.output_zero_point);
453 #if XNN_ARCH_ARM64
454     int16x8_t vacc0x01234567 = vqmovn_high_s32(vqmovn_s32(vacc0x0123), vacc0x4567);
455     int16x8_t vacc0x89ABCDEF = vqmovn_high_s32(vqmovn_s32(vacc0x89AB), vacc0xCDEF);
456     int16x8_t vacc1x01234567 = vqmovn_high_s32(vqmovn_s32(vacc1x0123), vacc1x4567);
457     int16x8_t vacc1x89ABCDEF = vqmovn_high_s32(vqmovn_s32(vacc1x89AB), vacc1xCDEF);
458     int16x8_t vacc2x01234567 = vqmovn_high_s32(vqmovn_s32(vacc2x0123), vacc2x4567);
459     int16x8_t vacc2x89ABCDEF = vqmovn_high_s32(vqmovn_s32(vacc2x89AB), vacc2xCDEF);
460     int16x8_t vacc3x01234567 = vqmovn_high_s32(vqmovn_s32(vacc3x0123), vacc3x4567);
461     int16x8_t vacc3x89ABCDEF = vqmovn_high_s32(vqmovn_s32(vacc3x89AB), vacc3xCDEF);
462 
463     vacc0x01234567 = vqaddq_s16(vacc0x01234567, voutput_zero_point);
464     vacc0x89ABCDEF = vqaddq_s16(vacc0x89ABCDEF, voutput_zero_point);
465     vacc1x01234567 = vqaddq_s16(vacc1x01234567, voutput_zero_point);
466     vacc1x89ABCDEF = vqaddq_s16(vacc1x89ABCDEF, voutput_zero_point);
467     vacc2x01234567 = vqaddq_s16(vacc2x01234567, voutput_zero_point);
468     vacc2x89ABCDEF = vqaddq_s16(vacc2x89ABCDEF, voutput_zero_point);
469     vacc3x01234567 = vqaddq_s16(vacc3x01234567, voutput_zero_point);
470     vacc3x89ABCDEF = vqaddq_s16(vacc3x89ABCDEF, voutput_zero_point);
471 
472     int8x16_t vout0x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc0x01234567), vacc0x89ABCDEF);
473     int8x16_t vout1x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc1x01234567), vacc1x89ABCDEF);
474     int8x16_t vout2x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc2x01234567), vacc2x89ABCDEF);
475     int8x16_t vout3x0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc3x01234567), vacc3x89ABCDEF);
476 #else
477     int16x8_t vacc0x01234567 = vcombine_s16(vqmovn_s32(vacc0x0123), vqmovn_s32(vacc0x4567));
478     int16x8_t vacc0x89ABCDEF = vcombine_s16(vqmovn_s32(vacc0x89AB), vqmovn_s32(vacc0xCDEF));
479     int16x8_t vacc1x01234567 = vcombine_s16(vqmovn_s32(vacc1x0123), vqmovn_s32(vacc1x4567));
480     int16x8_t vacc1x89ABCDEF = vcombine_s16(vqmovn_s32(vacc1x89AB), vqmovn_s32(vacc1xCDEF));
481     int16x8_t vacc2x01234567 = vcombine_s16(vqmovn_s32(vacc2x0123), vqmovn_s32(vacc2x4567));
482     int16x8_t vacc2x89ABCDEF = vcombine_s16(vqmovn_s32(vacc2x89AB), vqmovn_s32(vacc2xCDEF));
483     int16x8_t vacc3x01234567 = vcombine_s16(vqmovn_s32(vacc3x0123), vqmovn_s32(vacc3x4567));
484     int16x8_t vacc3x89ABCDEF = vcombine_s16(vqmovn_s32(vacc3x89AB), vqmovn_s32(vacc3xCDEF));
485 
486     vacc0x01234567 = vqaddq_s16(vacc0x01234567, voutput_zero_point);
487     vacc0x89ABCDEF = vqaddq_s16(vacc0x89ABCDEF, voutput_zero_point);
488     vacc1x01234567 = vqaddq_s16(vacc1x01234567, voutput_zero_point);
489     vacc1x89ABCDEF = vqaddq_s16(vacc1x89ABCDEF, voutput_zero_point);
490     vacc2x01234567 = vqaddq_s16(vacc2x01234567, voutput_zero_point);
491     vacc2x89ABCDEF = vqaddq_s16(vacc2x89ABCDEF, voutput_zero_point);
492     vacc3x01234567 = vqaddq_s16(vacc3x01234567, voutput_zero_point);
493     vacc3x89ABCDEF = vqaddq_s16(vacc3x89ABCDEF, voutput_zero_point);
494 
495     int8x16_t vout0x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc0x01234567), vqmovn_s16(vacc0x89ABCDEF));
496     int8x16_t vout1x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc1x01234567), vqmovn_s16(vacc1x89ABCDEF));
497     int8x16_t vout2x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc2x01234567), vqmovn_s16(vacc2x89ABCDEF));
498     int8x16_t vout3x0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc3x01234567), vqmovn_s16(vacc3x89ABCDEF));
499 #endif
500 
501     const int8x16_t voutput_min = vld1q_dup_s8(&params->rndnu_neon.output_min);
502     vout0x0123456789ABCDEF = vmaxq_s8(vout0x0123456789ABCDEF, voutput_min);
503     vout1x0123456789ABCDEF = vmaxq_s8(vout1x0123456789ABCDEF, voutput_min);
504     vout2x0123456789ABCDEF = vmaxq_s8(vout2x0123456789ABCDEF, voutput_min);
505     vout3x0123456789ABCDEF = vmaxq_s8(vout3x0123456789ABCDEF, voutput_min);
506 
507     const int8x16_t voutput_max = vld1q_dup_s8(&params->rndnu_neon.output_max);
508     vout0x0123456789ABCDEF = vminq_s8(vout0x0123456789ABCDEF, voutput_max);
509     vout1x0123456789ABCDEF = vminq_s8(vout1x0123456789ABCDEF, voutput_max);
510     vout2x0123456789ABCDEF = vminq_s8(vout2x0123456789ABCDEF, voutput_max);
511     vout3x0123456789ABCDEF = vminq_s8(vout3x0123456789ABCDEF, voutput_max);
512 
513     if (nc >= 16) {
514       vst1q_s8(c0 + 0, vout0x0123456789ABCDEF);
515       vst1q_s8(c1 + 0, vout1x0123456789ABCDEF);
516       vst1q_s8(c2 + 0, vout2x0123456789ABCDEF);
517       vst1q_s8(c3 + 0, vout3x0123456789ABCDEF);
518 
519       c0 = (int8_t*) ((uintptr_t) c0 + cn_stride);
520       c1 = (int8_t*) ((uintptr_t) c1 + cn_stride);
521       c2 = (int8_t*) ((uintptr_t) c2 + cn_stride);
522       c3 = (int8_t*) ((uintptr_t) c3 + cn_stride);
523 
524       a0 = (const int8_t*) ((uintptr_t) a0 - kc);
525       a1 = (const int8_t*) ((uintptr_t) a1 - kc);
526       a2 = (const int8_t*) ((uintptr_t) a2 - kc);
527       a3 = (const int8_t*) ((uintptr_t) a3 - kc);
528 
529       nc -= 16;
530     } else {
531       // Final case where not all of the 16 columns fit in the destination.
532       int8x16_t vout0x01234567_1x01234567 = vcombine_s8(vget_low_s8(vout0x0123456789ABCDEF), vget_low_s8(vout1x0123456789ABCDEF));
533       int8x16_t vout2x01234567_3x01234567 = vcombine_s8(vget_low_s8(vout2x0123456789ABCDEF), vget_low_s8(vout3x0123456789ABCDEF));
534       if (nc & 8) {
535         vst1_s8(c0, vget_low_s8(vout0x01234567_1x01234567)); c0 += 8;
536         vst1_s8(c1, vget_high_s8(vout0x01234567_1x01234567)); c1 += 8;
537         vst1_s8(c2, vget_low_s8(vout2x01234567_3x01234567)); c2 += 8;
538         vst1_s8(c3, vget_high_s8(vout2x01234567_3x01234567)); c3 += 8;
539         vout0x01234567_1x01234567 = vcombine_s8(vget_high_s8(vout0x0123456789ABCDEF), vget_high_s8(vout1x0123456789ABCDEF));
540         vout2x01234567_3x01234567 = vcombine_s8(vget_high_s8(vout2x0123456789ABCDEF), vget_high_s8(vout3x0123456789ABCDEF));
541       }
542       if (nc & 4) {
543         vst1q_lane_u32((void*) c0, vreinterpretq_u32_s8(vout0x01234567_1x01234567), 0); c0 += 4;
544         vst1q_lane_u32((void*) c1, vreinterpretq_u32_s8(vout0x01234567_1x01234567), 2); c1 += 4;
545         vst1q_lane_u32((void*) c2, vreinterpretq_u32_s8(vout2x01234567_3x01234567), 0); c2 += 4;
546         vst1q_lane_u32((void*) c3, vreinterpretq_u32_s8(vout2x01234567_3x01234567), 2); c3 += 4;
547         vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 4);
548         vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 4);
549       }
550       if (nc & 2) {
551         vst1q_lane_u16((void*) c0, vreinterpretq_u16_s8(vout0x01234567_1x01234567), 0); c0 += 2;
552         vst1q_lane_u16((void*) c1, vreinterpretq_u16_s8(vout0x01234567_1x01234567), 4); c1 += 2;
553         vst1q_lane_u16((void*) c2, vreinterpretq_u16_s8(vout2x01234567_3x01234567), 0); c2 += 2;
554         vst1q_lane_u16((void*) c3, vreinterpretq_u16_s8(vout2x01234567_3x01234567), 4); c3 += 2;
555         vout0x01234567_1x01234567 = vextq_s8(vout0x01234567_1x01234567, vout0x01234567_1x01234567, 2);
556         vout2x01234567_3x01234567 = vextq_s8(vout2x01234567_3x01234567, vout2x01234567_3x01234567, 2);
557       }
558       if (nc & 1) {
559         vst1q_lane_s8(c0, vout0x01234567_1x01234567, 0);
560         vst1q_lane_s8(c1, vout0x01234567_1x01234567, 8);
561         vst1q_lane_s8(c2, vout2x01234567_3x01234567, 0);
562         vst1q_lane_s8(c3, vout2x01234567_3x01234567, 8);
563       }
564 
565       nc = 0;
566     }
567   } while (nc != 0);
568 }
569