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