blob: 91d1032b2bf1ca4cc20a47d11c3524e0b8a7964b [file] [log] [blame]
Marat Dukhan59af5812021-06-29 18:09:57 -07001// 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
16
17void xnn_qc8_dwconv_minmax_fp32_ukernel_up16x25__neonv8_mul16(
18 size_t channels,
19 size_t output_width,
20 const int8_t** input,
21 const void* weights,
22 int8_t* output,
23 size_t input_stride,
24 size_t output_increment,
25 size_t input_offset,
26 const int8_t* zero,
27 const union xnn_qs8_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN
28{
29 assert(channels != 0);
30 assert(output_width != 0);
31
32 const int16x8_t voutput_zero_point = vld1q_dup_s16(&params->neon.output_zero_point);
33 const int8x16_t voutput_min = vld1q_dup_s8(&params->neon.output_min);
34 const int8x16_t voutput_max = vld1q_dup_s8(&params->neon.output_max);
35 do {
36 const int8_t* i0 = input[0];
37 assert(i0 != NULL);
38 if XNN_UNPREDICTABLE(i0 != zero) {
39 i0 = (const int8_t*) ((uintptr_t) i0 + input_offset);
40 }
41 const int8_t* i1 = input[1];
42 assert(i1 != NULL);
43 if XNN_UNPREDICTABLE(i1 != zero) {
44 i1 = (const int8_t*) ((uintptr_t) i1 + input_offset);
45 }
46 const int8_t* i2 = input[2];
47 assert(i2 != NULL);
48 if XNN_UNPREDICTABLE(i2 != zero) {
49 i2 = (const int8_t*) ((uintptr_t) i2 + input_offset);
50 }
51 const int8_t* i3 = input[3];
52 assert(i3 != NULL);
53 if XNN_UNPREDICTABLE(i3 != zero) {
54 i3 = (const int8_t*) ((uintptr_t) i3 + input_offset);
55 }
56 const int8_t* i4 = input[4];
57 assert(i4 != NULL);
58 if XNN_UNPREDICTABLE(i4 != zero) {
59 i4 = (const int8_t*) ((uintptr_t) i4 + input_offset);
60 }
61 const int8_t* i5 = input[5];
62 assert(i5 != NULL);
63 if XNN_UNPREDICTABLE(i5 != zero) {
64 i5 = (const int8_t*) ((uintptr_t) i5 + input_offset);
65 }
66 const int8_t* i6 = input[6];
67 assert(i6 != NULL);
68 if XNN_UNPREDICTABLE(i6 != zero) {
69 i6 = (const int8_t*) ((uintptr_t) i6 + input_offset);
70 }
71 const int8_t* i7 = input[7];
72 assert(i7 != NULL);
73 if XNN_UNPREDICTABLE(i7 != zero) {
74 i7 = (const int8_t*) ((uintptr_t) i7 + input_offset);
75 }
76 const int8_t* i8 = input[8];
77 assert(i8 != NULL);
78 if XNN_UNPREDICTABLE(i8 != zero) {
79 i8 = (const int8_t*) ((uintptr_t) i8 + input_offset);
80 }
81 const int8_t* i9 = input[9];
82 assert(i9 != NULL);
83 if XNN_UNPREDICTABLE(i9 != zero) {
84 i9 = (const int8_t*) ((uintptr_t) i9 + input_offset);
85 }
86 const int8_t* i10 = input[10];
87 assert(i10 != NULL);
88 if XNN_UNPREDICTABLE(i10 != zero) {
89 i10 = (const int8_t*) ((uintptr_t) i10 + input_offset);
90 }
91 const int8_t* i11 = input[11];
92 assert(i11 != NULL);
93 if XNN_UNPREDICTABLE(i11 != zero) {
94 i11 = (const int8_t*) ((uintptr_t) i11 + input_offset);
95 }
96 const int8_t* i12 = input[12];
97 assert(i12 != NULL);
98 if XNN_UNPREDICTABLE(i12 != zero) {
99 i12 = (const int8_t*) ((uintptr_t) i12 + input_offset);
100 }
101 const int8_t* i13 = input[13];
102 assert(i13 != NULL);
103 if XNN_UNPREDICTABLE(i13 != zero) {
104 i13 = (const int8_t*) ((uintptr_t) i13 + input_offset);
105 }
106 const int8_t* i14 = input[14];
107 assert(i14 != NULL);
108 if XNN_UNPREDICTABLE(i14 != zero) {
109 i14 = (const int8_t*) ((uintptr_t) i14 + input_offset);
110 }
111 const int8_t* i15 = input[15];
112 assert(i15 != NULL);
113 if XNN_UNPREDICTABLE(i15 != zero) {
114 i15 = (const int8_t*) ((uintptr_t) i15 + input_offset);
115 }
116 const int8_t* i16 = input[16];
117 assert(i16 != NULL);
118 if XNN_UNPREDICTABLE(i16 != zero) {
119 i16 = (const int8_t*) ((uintptr_t) i16 + input_offset);
120 }
121 const int8_t* i17 = input[17];
122 assert(i17 != NULL);
123 if XNN_UNPREDICTABLE(i17 != zero) {
124 i17 = (const int8_t*) ((uintptr_t) i17 + input_offset);
125 }
126 const int8_t* i18 = input[18];
127 assert(i18 != NULL);
128 if XNN_UNPREDICTABLE(i18 != zero) {
129 i18 = (const int8_t*) ((uintptr_t) i18 + input_offset);
130 }
131 const int8_t* i19 = input[19];
132 assert(i19 != NULL);
133 if XNN_UNPREDICTABLE(i19 != zero) {
134 i19 = (const int8_t*) ((uintptr_t) i19 + input_offset);
135 }
136 const int8_t* i20 = input[20];
137 assert(i20 != NULL);
138 if XNN_UNPREDICTABLE(i20 != zero) {
139 i20 = (const int8_t*) ((uintptr_t) i20 + input_offset);
140 }
141 const int8_t* i21 = input[21];
142 assert(i21 != NULL);
143 if XNN_UNPREDICTABLE(i21 != zero) {
144 i21 = (const int8_t*) ((uintptr_t) i21 + input_offset);
145 }
146 const int8_t* i22 = input[22];
147 assert(i22 != NULL);
148 if XNN_UNPREDICTABLE(i22 != zero) {
149 i22 = (const int8_t*) ((uintptr_t) i22 + input_offset);
150 }
151 const int8_t* i23 = input[23];
152 assert(i23 != NULL);
153 if XNN_UNPREDICTABLE(i23 != zero) {
154 i23 = (const int8_t*) ((uintptr_t) i23 + input_offset);
155 }
156 const int8_t* i24 = input[24];
157 assert(i24 != NULL);
158 if XNN_UNPREDICTABLE(i24 != zero) {
159 i24 = (const int8_t*) ((uintptr_t) i24 + input_offset);
160 }
161 input = (const int8_t**) ((uintptr_t) input + input_stride);
162
163 size_t c = channels;
164 const void* w = weights;
165 for (; c >= 16; c -= 16) {
166 int32x4_t vacc0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
167 int32x4_t vacc4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
168 int32x4_t vacc89AB = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
169 int32x4_t vaccCDEF = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
170
171
172 const int16x8_t vi0x01234567 = vmovl_s8(vld1_s8(i0)); i0 += 8;
173 const int16x8_t vk0x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
174 const int16x8_t vi0x89ABCDEF = vmovl_s8(vld1_s8(i0)); i0 += 8;
175 const int16x8_t vk0x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
176
177 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi0x01234567), vget_low_s16(vk0x01234567));
178 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi0x01234567), vget_high_s16(vk0x01234567));
179 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi0x89ABCDEF), vget_low_s16(vk0x89ABCDEF));
180 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi0x89ABCDEF), vget_high_s16(vk0x89ABCDEF));
181
182 const int16x8_t vi1x01234567 = vmovl_s8(vld1_s8(i1)); i1 += 8;
183 const int16x8_t vk1x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
184 const int16x8_t vi1x89ABCDEF = vmovl_s8(vld1_s8(i1)); i1 += 8;
185 const int16x8_t vk1x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
186
187 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi1x01234567), vget_low_s16(vk1x01234567));
188 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi1x01234567), vget_high_s16(vk1x01234567));
189 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi1x89ABCDEF), vget_low_s16(vk1x89ABCDEF));
190 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi1x89ABCDEF), vget_high_s16(vk1x89ABCDEF));
191
192 const int16x8_t vi2x01234567 = vmovl_s8(vld1_s8(i2)); i2 += 8;
193 const int16x8_t vk2x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
194 const int16x8_t vi2x89ABCDEF = vmovl_s8(vld1_s8(i2)); i2 += 8;
195 const int16x8_t vk2x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
196
197 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi2x01234567), vget_low_s16(vk2x01234567));
198 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi2x01234567), vget_high_s16(vk2x01234567));
199 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi2x89ABCDEF), vget_low_s16(vk2x89ABCDEF));
200 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi2x89ABCDEF), vget_high_s16(vk2x89ABCDEF));
201
202 const int16x8_t vi3x01234567 = vmovl_s8(vld1_s8(i3)); i3 += 8;
203 const int16x8_t vk3x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
204 const int16x8_t vi3x89ABCDEF = vmovl_s8(vld1_s8(i3)); i3 += 8;
205 const int16x8_t vk3x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
206
207 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi3x01234567), vget_low_s16(vk3x01234567));
208 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi3x01234567), vget_high_s16(vk3x01234567));
209 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi3x89ABCDEF), vget_low_s16(vk3x89ABCDEF));
210 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi3x89ABCDEF), vget_high_s16(vk3x89ABCDEF));
211
212 const int16x8_t vi4x01234567 = vmovl_s8(vld1_s8(i4)); i4 += 8;
213 const int16x8_t vk4x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
214 const int16x8_t vi4x89ABCDEF = vmovl_s8(vld1_s8(i4)); i4 += 8;
215 const int16x8_t vk4x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
216
217 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi4x01234567), vget_low_s16(vk4x01234567));
218 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi4x01234567), vget_high_s16(vk4x01234567));
219 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi4x89ABCDEF), vget_low_s16(vk4x89ABCDEF));
220 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi4x89ABCDEF), vget_high_s16(vk4x89ABCDEF));
221
222 const int16x8_t vi5x01234567 = vmovl_s8(vld1_s8(i5)); i5 += 8;
223 const int16x8_t vk5x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
224 const int16x8_t vi5x89ABCDEF = vmovl_s8(vld1_s8(i5)); i5 += 8;
225 const int16x8_t vk5x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
226
227 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi5x01234567), vget_low_s16(vk5x01234567));
228 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi5x01234567), vget_high_s16(vk5x01234567));
229 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi5x89ABCDEF), vget_low_s16(vk5x89ABCDEF));
230 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi5x89ABCDEF), vget_high_s16(vk5x89ABCDEF));
231
232 const int16x8_t vi6x01234567 = vmovl_s8(vld1_s8(i6)); i6 += 8;
233 const int16x8_t vk6x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
234 const int16x8_t vi6x89ABCDEF = vmovl_s8(vld1_s8(i6)); i6 += 8;
235 const int16x8_t vk6x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
236
237 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi6x01234567), vget_low_s16(vk6x01234567));
238 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi6x01234567), vget_high_s16(vk6x01234567));
239 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi6x89ABCDEF), vget_low_s16(vk6x89ABCDEF));
240 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi6x89ABCDEF), vget_high_s16(vk6x89ABCDEF));
241
242 const int16x8_t vi7x01234567 = vmovl_s8(vld1_s8(i7)); i7 += 8;
243 const int16x8_t vk7x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
244 const int16x8_t vi7x89ABCDEF = vmovl_s8(vld1_s8(i7)); i7 += 8;
245 const int16x8_t vk7x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
246
247 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi7x01234567), vget_low_s16(vk7x01234567));
248 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi7x01234567), vget_high_s16(vk7x01234567));
249 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi7x89ABCDEF), vget_low_s16(vk7x89ABCDEF));
250 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi7x89ABCDEF), vget_high_s16(vk7x89ABCDEF));
251
252 const int16x8_t vi8x01234567 = vmovl_s8(vld1_s8(i8)); i8 += 8;
253 const int16x8_t vk8x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
254 const int16x8_t vi8x89ABCDEF = vmovl_s8(vld1_s8(i8)); i8 += 8;
255 const int16x8_t vk8x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
256
257 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi8x01234567), vget_low_s16(vk8x01234567));
258 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi8x01234567), vget_high_s16(vk8x01234567));
259 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi8x89ABCDEF), vget_low_s16(vk8x89ABCDEF));
260 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi8x89ABCDEF), vget_high_s16(vk8x89ABCDEF));
261
262 const int16x8_t vi9x01234567 = vmovl_s8(vld1_s8(i9)); i9 += 8;
263 const int16x8_t vk9x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
264 const int16x8_t vi9x89ABCDEF = vmovl_s8(vld1_s8(i9)); i9 += 8;
265 const int16x8_t vk9x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
266
267 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi9x01234567), vget_low_s16(vk9x01234567));
268 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi9x01234567), vget_high_s16(vk9x01234567));
269 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi9x89ABCDEF), vget_low_s16(vk9x89ABCDEF));
270 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi9x89ABCDEF), vget_high_s16(vk9x89ABCDEF));
271
272 const int16x8_t vi10x01234567 = vmovl_s8(vld1_s8(i10)); i10 += 8;
273 const int16x8_t vk10x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
274 const int16x8_t vi10x89ABCDEF = vmovl_s8(vld1_s8(i10)); i10 += 8;
275 const int16x8_t vk10x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
276
277 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi10x01234567), vget_low_s16(vk10x01234567));
278 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi10x01234567), vget_high_s16(vk10x01234567));
279 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi10x89ABCDEF), vget_low_s16(vk10x89ABCDEF));
280 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi10x89ABCDEF), vget_high_s16(vk10x89ABCDEF));
281
282 const int16x8_t vi11x01234567 = vmovl_s8(vld1_s8(i11)); i11 += 8;
283 const int16x8_t vk11x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
284 const int16x8_t vi11x89ABCDEF = vmovl_s8(vld1_s8(i11)); i11 += 8;
285 const int16x8_t vk11x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
286
287 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi11x01234567), vget_low_s16(vk11x01234567));
288 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi11x01234567), vget_high_s16(vk11x01234567));
289 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi11x89ABCDEF), vget_low_s16(vk11x89ABCDEF));
290 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi11x89ABCDEF), vget_high_s16(vk11x89ABCDEF));
291
292 const int16x8_t vi12x01234567 = vmovl_s8(vld1_s8(i12)); i12 += 8;
293 const int16x8_t vk12x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
294 const int16x8_t vi12x89ABCDEF = vmovl_s8(vld1_s8(i12)); i12 += 8;
295 const int16x8_t vk12x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
296
297 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi12x01234567), vget_low_s16(vk12x01234567));
298 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi12x01234567), vget_high_s16(vk12x01234567));
299 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi12x89ABCDEF), vget_low_s16(vk12x89ABCDEF));
300 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi12x89ABCDEF), vget_high_s16(vk12x89ABCDEF));
301
302 const int16x8_t vi13x01234567 = vmovl_s8(vld1_s8(i13)); i13 += 8;
303 const int16x8_t vk13x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
304 const int16x8_t vi13x89ABCDEF = vmovl_s8(vld1_s8(i13)); i13 += 8;
305 const int16x8_t vk13x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
306
307 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi13x01234567), vget_low_s16(vk13x01234567));
308 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi13x01234567), vget_high_s16(vk13x01234567));
309 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi13x89ABCDEF), vget_low_s16(vk13x89ABCDEF));
310 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi13x89ABCDEF), vget_high_s16(vk13x89ABCDEF));
311
312 const int16x8_t vi14x01234567 = vmovl_s8(vld1_s8(i14)); i14 += 8;
313 const int16x8_t vk14x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
314 const int16x8_t vi14x89ABCDEF = vmovl_s8(vld1_s8(i14)); i14 += 8;
315 const int16x8_t vk14x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
316
317 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi14x01234567), vget_low_s16(vk14x01234567));
318 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi14x01234567), vget_high_s16(vk14x01234567));
319 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi14x89ABCDEF), vget_low_s16(vk14x89ABCDEF));
320 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi14x89ABCDEF), vget_high_s16(vk14x89ABCDEF));
321
322 const int16x8_t vi15x01234567 = vmovl_s8(vld1_s8(i15)); i15 += 8;
323 const int16x8_t vk15x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
324 const int16x8_t vi15x89ABCDEF = vmovl_s8(vld1_s8(i15)); i15 += 8;
325 const int16x8_t vk15x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
326
327 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi15x01234567), vget_low_s16(vk15x01234567));
328 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi15x01234567), vget_high_s16(vk15x01234567));
329 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi15x89ABCDEF), vget_low_s16(vk15x89ABCDEF));
330 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi15x89ABCDEF), vget_high_s16(vk15x89ABCDEF));
331
332 const int16x8_t vi16x01234567 = vmovl_s8(vld1_s8(i16)); i16 += 8;
333 const int16x8_t vk16x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
334 const int16x8_t vi16x89ABCDEF = vmovl_s8(vld1_s8(i16)); i16 += 8;
335 const int16x8_t vk16x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
336
337 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi16x01234567), vget_low_s16(vk16x01234567));
338 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi16x01234567), vget_high_s16(vk16x01234567));
339 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi16x89ABCDEF), vget_low_s16(vk16x89ABCDEF));
340 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi16x89ABCDEF), vget_high_s16(vk16x89ABCDEF));
341
342 const int16x8_t vi17x01234567 = vmovl_s8(vld1_s8(i17)); i17 += 8;
343 const int16x8_t vk17x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
344 const int16x8_t vi17x89ABCDEF = vmovl_s8(vld1_s8(i17)); i17 += 8;
345 const int16x8_t vk17x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
346
347 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi17x01234567), vget_low_s16(vk17x01234567));
348 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi17x01234567), vget_high_s16(vk17x01234567));
349 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi17x89ABCDEF), vget_low_s16(vk17x89ABCDEF));
350 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi17x89ABCDEF), vget_high_s16(vk17x89ABCDEF));
351
352 const int16x8_t vi18x01234567 = vmovl_s8(vld1_s8(i18)); i18 += 8;
353 const int16x8_t vk18x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
354 const int16x8_t vi18x89ABCDEF = vmovl_s8(vld1_s8(i18)); i18 += 8;
355 const int16x8_t vk18x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
356
357 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi18x01234567), vget_low_s16(vk18x01234567));
358 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi18x01234567), vget_high_s16(vk18x01234567));
359 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi18x89ABCDEF), vget_low_s16(vk18x89ABCDEF));
360 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi18x89ABCDEF), vget_high_s16(vk18x89ABCDEF));
361
362 const int16x8_t vi19x01234567 = vmovl_s8(vld1_s8(i19)); i19 += 8;
363 const int16x8_t vk19x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
364 const int16x8_t vi19x89ABCDEF = vmovl_s8(vld1_s8(i19)); i19 += 8;
365 const int16x8_t vk19x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
366
367 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi19x01234567), vget_low_s16(vk19x01234567));
368 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi19x01234567), vget_high_s16(vk19x01234567));
369 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi19x89ABCDEF), vget_low_s16(vk19x89ABCDEF));
370 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi19x89ABCDEF), vget_high_s16(vk19x89ABCDEF));
371
372 const int16x8_t vi20x01234567 = vmovl_s8(vld1_s8(i20)); i20 += 8;
373 const int16x8_t vk20x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
374 const int16x8_t vi20x89ABCDEF = vmovl_s8(vld1_s8(i20)); i20 += 8;
375 const int16x8_t vk20x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
376
377 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi20x01234567), vget_low_s16(vk20x01234567));
378 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi20x01234567), vget_high_s16(vk20x01234567));
379 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi20x89ABCDEF), vget_low_s16(vk20x89ABCDEF));
380 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi20x89ABCDEF), vget_high_s16(vk20x89ABCDEF));
381
382 const int16x8_t vi21x01234567 = vmovl_s8(vld1_s8(i21)); i21 += 8;
383 const int16x8_t vk21x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
384 const int16x8_t vi21x89ABCDEF = vmovl_s8(vld1_s8(i21)); i21 += 8;
385 const int16x8_t vk21x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
386
387 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi21x01234567), vget_low_s16(vk21x01234567));
388 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi21x01234567), vget_high_s16(vk21x01234567));
389 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi21x89ABCDEF), vget_low_s16(vk21x89ABCDEF));
390 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi21x89ABCDEF), vget_high_s16(vk21x89ABCDEF));
391
392 const int16x8_t vi22x01234567 = vmovl_s8(vld1_s8(i22)); i22 += 8;
393 const int16x8_t vk22x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
394 const int16x8_t vi22x89ABCDEF = vmovl_s8(vld1_s8(i22)); i22 += 8;
395 const int16x8_t vk22x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
396
397 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi22x01234567), vget_low_s16(vk22x01234567));
398 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi22x01234567), vget_high_s16(vk22x01234567));
399 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi22x89ABCDEF), vget_low_s16(vk22x89ABCDEF));
400 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi22x89ABCDEF), vget_high_s16(vk22x89ABCDEF));
401
402 const int16x8_t vi23x01234567 = vmovl_s8(vld1_s8(i23)); i23 += 8;
403 const int16x8_t vk23x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
404 const int16x8_t vi23x89ABCDEF = vmovl_s8(vld1_s8(i23)); i23 += 8;
405 const int16x8_t vk23x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
406
407 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi23x01234567), vget_low_s16(vk23x01234567));
408 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi23x01234567), vget_high_s16(vk23x01234567));
409 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi23x89ABCDEF), vget_low_s16(vk23x89ABCDEF));
410 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi23x89ABCDEF), vget_high_s16(vk23x89ABCDEF));
411
412 const int16x8_t vi24x01234567 = vmovl_s8(vld1_s8(i24)); i24 += 8;
413 const int16x8_t vk24x01234567 = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
414 const int16x8_t vi24x89ABCDEF = vmovl_s8(vld1_s8(i24)); i24 += 8;
415 const int16x8_t vk24x89ABCDEF = vmovl_s8(vld1_s8(w)); w = (const void*) ((uintptr_t) w + 8 * sizeof(int8_t));
416
417 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi24x01234567), vget_low_s16(vk24x01234567));
418 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi24x01234567), vget_high_s16(vk24x01234567));
419 vacc89AB = vmlal_s16(vacc89AB, vget_low_s16(vi24x89ABCDEF), vget_low_s16(vk24x89ABCDEF));
420 vaccCDEF = vmlal_s16(vaccCDEF, vget_high_s16(vi24x89ABCDEF), vget_high_s16(vk24x89ABCDEF));
421
422 float32x4_t vfpacc0123 = vcvtq_f32_s32(vacc0123);
423 float32x4_t vfpacc4567 = vcvtq_f32_s32(vacc4567);
424 float32x4_t vfpacc89AB = vcvtq_f32_s32(vacc89AB);
425 float32x4_t vfpaccCDEF = vcvtq_f32_s32(vaccCDEF);
426
427 const float32x4_t vscale0123 = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4);
428 const float32x4_t vscale4567 = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4);
429 const float32x4_t vscale89AB = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4);
430 const float32x4_t vscaleCDEF = vld1q_f32((const float*) w); w = (const void*) ((const float*) w + 4);
431
432 vfpacc0123 = vmulq_f32(vfpacc0123, vscale0123);
433 vfpacc4567 = vmulq_f32(vfpacc4567, vscale4567);
434 vfpacc89AB = vmulq_f32(vfpacc89AB, vscale89AB);
435 vfpaccCDEF = vmulq_f32(vfpaccCDEF, vscaleCDEF);
436
437 vacc0123 = vcvtnq_s32_f32(vfpacc0123);
438 vacc4567 = vcvtnq_s32_f32(vfpacc4567);
439 vacc89AB = vcvtnq_s32_f32(vfpacc89AB);
440 vaccCDEF = vcvtnq_s32_f32(vfpaccCDEF);
441
442#if XNN_ARCH_ARM64
443 const int16x8_t vacc01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567), voutput_zero_point);
444 const int16x8_t vacc89ABCDEF = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc89AB), vaccCDEF), voutput_zero_point);
445
446 int8x16_t vout0123456789ABCDEF = vqmovn_high_s16(vqmovn_s16(vacc01234567), vacc89ABCDEF);
447#else
448 const int16x8_t vacc01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567)), voutput_zero_point);
449 const int16x8_t vacc89ABCDEF = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc89AB), vqmovn_s32(vaccCDEF)), voutput_zero_point);
450
451 int8x16_t vout0123456789ABCDEF = vcombine_s8(vqmovn_s16(vacc01234567), vqmovn_s16(vacc89ABCDEF));
452#endif
453
454 vout0123456789ABCDEF = vmaxq_s8(vout0123456789ABCDEF, voutput_min);
455
456 vout0123456789ABCDEF = vminq_s8(vout0123456789ABCDEF, voutput_max);
457
458 vst1q_s8(output, vout0123456789ABCDEF); output += 16;
459 }
460 if XNN_UNLIKELY(c != 0) {
461 const int8_t* k = (const int8_t*) ((uintptr_t) w + 16 * sizeof(int32_t));
462 do {
463 int32x4_t vacc0123 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
464 int32x4_t vacc4567 = vld1q_s32(w); w = (const void*) ((uintptr_t) w + 4 * sizeof(int32_t));
465
466 const int16x8_t vi0x01234567 = vmovl_s8(vld1_s8(i0)); i0 += 8;
467 const int16x8_t vk0x01234567 = vmovl_s8(vld1_s8(k)); k += 8;
468
469 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi0x01234567), vget_low_s16(vk0x01234567));
470 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi0x01234567), vget_high_s16(vk0x01234567));
471 const int16x8_t vi1x01234567 = vmovl_s8(vld1_s8(i1)); i1 += 8;
472 const int16x8_t vk1x01234567 = vmovl_s8(vld1_s8((const void*) (k + 8)));
473
474 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi1x01234567), vget_low_s16(vk1x01234567));
475 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi1x01234567), vget_high_s16(vk1x01234567));
476 const int16x8_t vi2x01234567 = vmovl_s8(vld1_s8(i2)); i2 += 8;
477 const int16x8_t vk2x01234567 = vmovl_s8(vld1_s8((const void*) (k + 24)));
478
479 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi2x01234567), vget_low_s16(vk2x01234567));
480 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi2x01234567), vget_high_s16(vk2x01234567));
481 const int16x8_t vi3x01234567 = vmovl_s8(vld1_s8(i3)); i3 += 8;
482 const int16x8_t vk3x01234567 = vmovl_s8(vld1_s8((const void*) (k + 40)));
483
484 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi3x01234567), vget_low_s16(vk3x01234567));
485 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi3x01234567), vget_high_s16(vk3x01234567));
486 const int16x8_t vi4x01234567 = vmovl_s8(vld1_s8(i4)); i4 += 8;
487 const int16x8_t vk4x01234567 = vmovl_s8(vld1_s8((const void*) (k + 56)));
488
489 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi4x01234567), vget_low_s16(vk4x01234567));
490 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi4x01234567), vget_high_s16(vk4x01234567));
491 const int16x8_t vi5x01234567 = vmovl_s8(vld1_s8(i5)); i5 += 8;
492 const int16x8_t vk5x01234567 = vmovl_s8(vld1_s8((const void*) (k + 72)));
493
494 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi5x01234567), vget_low_s16(vk5x01234567));
495 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi5x01234567), vget_high_s16(vk5x01234567));
496 const int16x8_t vi6x01234567 = vmovl_s8(vld1_s8(i6)); i6 += 8;
497 const int16x8_t vk6x01234567 = vmovl_s8(vld1_s8((const void*) (k + 88)));
498
499 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi6x01234567), vget_low_s16(vk6x01234567));
500 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi6x01234567), vget_high_s16(vk6x01234567));
501 const int16x8_t vi7x01234567 = vmovl_s8(vld1_s8(i7)); i7 += 8;
502 const int16x8_t vk7x01234567 = vmovl_s8(vld1_s8((const void*) (k + 104)));
503
504 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi7x01234567), vget_low_s16(vk7x01234567));
505 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi7x01234567), vget_high_s16(vk7x01234567));
506 const int16x8_t vi8x01234567 = vmovl_s8(vld1_s8(i8)); i8 += 8;
507 const int16x8_t vk8x01234567 = vmovl_s8(vld1_s8((const void*) (k + 120)));
508
509 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi8x01234567), vget_low_s16(vk8x01234567));
510 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi8x01234567), vget_high_s16(vk8x01234567));
511 const int16x8_t vi9x01234567 = vmovl_s8(vld1_s8(i9)); i9 += 8;
512 const int16x8_t vk9x01234567 = vmovl_s8(vld1_s8((const void*) (k + 136)));
513
514 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi9x01234567), vget_low_s16(vk9x01234567));
515 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi9x01234567), vget_high_s16(vk9x01234567));
516 const int16x8_t vi10x01234567 = vmovl_s8(vld1_s8(i10)); i10 += 8;
517 const int16x8_t vk10x01234567 = vmovl_s8(vld1_s8((const void*) (k + 152)));
518
519 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi10x01234567), vget_low_s16(vk10x01234567));
520 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi10x01234567), vget_high_s16(vk10x01234567));
521 const int16x8_t vi11x01234567 = vmovl_s8(vld1_s8(i11)); i11 += 8;
522 const int16x8_t vk11x01234567 = vmovl_s8(vld1_s8((const void*) (k + 168)));
523
524 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi11x01234567), vget_low_s16(vk11x01234567));
525 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi11x01234567), vget_high_s16(vk11x01234567));
526 const int16x8_t vi12x01234567 = vmovl_s8(vld1_s8(i12)); i12 += 8;
527 const int16x8_t vk12x01234567 = vmovl_s8(vld1_s8((const void*) (k + 184)));
528
529 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi12x01234567), vget_low_s16(vk12x01234567));
530 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi12x01234567), vget_high_s16(vk12x01234567));
531 const int16x8_t vi13x01234567 = vmovl_s8(vld1_s8(i13)); i13 += 8;
532 const int16x8_t vk13x01234567 = vmovl_s8(vld1_s8((const void*) (k + 200)));
533
534 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi13x01234567), vget_low_s16(vk13x01234567));
535 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi13x01234567), vget_high_s16(vk13x01234567));
536 const int16x8_t vi14x01234567 = vmovl_s8(vld1_s8(i14)); i14 += 8;
537 const int16x8_t vk14x01234567 = vmovl_s8(vld1_s8((const void*) (k + 216)));
538
539 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi14x01234567), vget_low_s16(vk14x01234567));
540 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi14x01234567), vget_high_s16(vk14x01234567));
541 const int16x8_t vi15x01234567 = vmovl_s8(vld1_s8(i15)); i15 += 8;
542 const int16x8_t vk15x01234567 = vmovl_s8(vld1_s8((const void*) (k + 232)));
543
544 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi15x01234567), vget_low_s16(vk15x01234567));
545 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi15x01234567), vget_high_s16(vk15x01234567));
546 const int16x8_t vi16x01234567 = vmovl_s8(vld1_s8(i16)); i16 += 8;
547 const int16x8_t vk16x01234567 = vmovl_s8(vld1_s8((const void*) (k + 248)));
548
549 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi16x01234567), vget_low_s16(vk16x01234567));
550 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi16x01234567), vget_high_s16(vk16x01234567));
551 const int16x8_t vi17x01234567 = vmovl_s8(vld1_s8(i17)); i17 += 8;
552 const int16x8_t vk17x01234567 = vmovl_s8(vld1_s8((const void*) (k + 264)));
553
554 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi17x01234567), vget_low_s16(vk17x01234567));
555 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi17x01234567), vget_high_s16(vk17x01234567));
556 const int16x8_t vi18x01234567 = vmovl_s8(vld1_s8(i18)); i18 += 8;
557 const int16x8_t vk18x01234567 = vmovl_s8(vld1_s8((const void*) (k + 280)));
558
559 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi18x01234567), vget_low_s16(vk18x01234567));
560 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi18x01234567), vget_high_s16(vk18x01234567));
561 const int16x8_t vi19x01234567 = vmovl_s8(vld1_s8(i19)); i19 += 8;
562 const int16x8_t vk19x01234567 = vmovl_s8(vld1_s8((const void*) (k + 296)));
563
564 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi19x01234567), vget_low_s16(vk19x01234567));
565 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi19x01234567), vget_high_s16(vk19x01234567));
566 const int16x8_t vi20x01234567 = vmovl_s8(vld1_s8(i20)); i20 += 8;
567 const int16x8_t vk20x01234567 = vmovl_s8(vld1_s8((const void*) (k + 312)));
568
569 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi20x01234567), vget_low_s16(vk20x01234567));
570 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi20x01234567), vget_high_s16(vk20x01234567));
571 const int16x8_t vi21x01234567 = vmovl_s8(vld1_s8(i21)); i21 += 8;
572 const int16x8_t vk21x01234567 = vmovl_s8(vld1_s8((const void*) (k + 328)));
573
574 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi21x01234567), vget_low_s16(vk21x01234567));
575 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi21x01234567), vget_high_s16(vk21x01234567));
576 const int16x8_t vi22x01234567 = vmovl_s8(vld1_s8(i22)); i22 += 8;
577 const int16x8_t vk22x01234567 = vmovl_s8(vld1_s8((const void*) (k + 344)));
578
579 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi22x01234567), vget_low_s16(vk22x01234567));
580 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi22x01234567), vget_high_s16(vk22x01234567));
581 const int16x8_t vi23x01234567 = vmovl_s8(vld1_s8(i23)); i23 += 8;
582 const int16x8_t vk23x01234567 = vmovl_s8(vld1_s8((const void*) (k + 360)));
583
584 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi23x01234567), vget_low_s16(vk23x01234567));
585 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi23x01234567), vget_high_s16(vk23x01234567));
586 const int16x8_t vi24x01234567 = vmovl_s8(vld1_s8(i24)); i24 += 8;
587 const int16x8_t vk24x01234567 = vmovl_s8(vld1_s8((const void*) (k + 376)));
588
589 vacc0123 = vmlal_s16(vacc0123, vget_low_s16(vi24x01234567), vget_low_s16(vk24x01234567));
590 vacc4567 = vmlal_s16(vacc4567, vget_high_s16(vi24x01234567), vget_high_s16(vk24x01234567));
591
592 float32x4_t vfpacc0123 = vcvtq_f32_s32(vacc0123);
593 float32x4_t vfpacc4567 = vcvtq_f32_s32(vacc4567);
594
595 const float32x4_t vscale0123 = vld1q_f32((const float*) ((uintptr_t) w + 8 * sizeof(int32_t) + 400 * sizeof(int8_t)));
596 const float32x4_t vscale4567 = vld1q_f32((const float*) ((uintptr_t) w + 8 * sizeof(int32_t) + 400 * sizeof(int8_t) + 4 * sizeof(float)));
597 vfpacc0123 = vmulq_f32(vfpacc0123, vscale0123);
598 vfpacc4567 = vmulq_f32(vfpacc4567, vscale4567);
599
600 vacc0123 = vcvtnq_s32_f32(vfpacc0123);
601 vacc4567 = vcvtnq_s32_f32(vfpacc4567);
602
603#if XNN_ARCH_ARM64
604 const int16x8_t vacc01234567 = vqaddq_s16(vqmovn_high_s32(vqmovn_s32(vacc0123), vacc4567), voutput_zero_point);
605 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
606#else
607 const int16x8_t vacc01234567 = vqaddq_s16(vcombine_s16(vqmovn_s32(vacc0123), vqmovn_s32(vacc4567)), voutput_zero_point);
608 int8x8_t vout01234567 = vqmovn_s16(vacc01234567);
609#endif
610
611 vout01234567 = vmax_s8(vout01234567, vget_low_s8(voutput_min));
612 vout01234567 = vmin_s8(vout01234567, vget_low_s8(voutput_max));
613
614 if XNN_LIKELY(c >= 8) {
615 vst1_s8(output, vout01234567); output += 8;
616 c -= 8;
617 } else {
618 if (c & 4) {
619 vst1_lane_u32(__builtin_assume_aligned(output, 1), vreinterpret_u32_s8(vout01234567), 0); output += 4;
620 vout01234567 = vext_s8(vout01234567, vout01234567, 4);
621 }
622 if (c & 2) {
623 vst1_lane_u16(__builtin_assume_aligned(output, 1), vreinterpret_u16_s8(vout01234567), 0); output += 2;
624 vout01234567 = vext_s8(vout01234567, vout01234567, 2);
625 }
626 if (c & 1) {
627 vst1_lane_s8(output, vout01234567, 0); output += 1;
628 }
629 c = 0;
630 }
631 } while (c != 0);
632 }
633
634 output = (int8_t*) ((uintptr_t) output + output_increment);
635 } while (--output_width != 0);
636}