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