1 // Auto-generated file. Do not edit!
2 // Template: src/qs8-dwconv/unipass-scalar.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 #include <math.h>
12
13 #include <xnnpack/dwconv.h>
14 #include <xnnpack/math.h>
15 #include <xnnpack/unaligned.h>
16
17
xnn_qu8_dwconv_minmax_fp32_ukernel_up2x25__scalar_lrintf(size_t channels,size_t output_width,const uint8_t ** input,const void * weights,uint8_t * output,size_t input_stride,size_t output_increment,size_t input_offset,const uint8_t * zero,const union xnn_qu8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS (1)])18 void xnn_qu8_dwconv_minmax_fp32_ukernel_up2x25__scalar_lrintf(
19 size_t channels,
20 size_t output_width,
21 const uint8_t** input,
22 const void* weights,
23 uint8_t* output,
24 size_t input_stride,
25 size_t output_increment,
26 size_t input_offset,
27 const uint8_t* zero,
28 const union xnn_qu8_conv_minmax_params params[restrict XNN_MIN_ELEMENTS(1)])
29 {
30 assert(channels != 0);
31 assert(output_width != 0);
32
33 const float vscale = params->fp32_scalar_lrintf.scale;
34 const float voutput_min_less_zero_point = params->fp32_scalar_lrintf.output_min_less_zero_point;
35 const float voutput_max_less_zero_point = params->fp32_scalar_lrintf.output_max_less_zero_point;
36 const int32_t voutput_zero_point = params->fp32_scalar_lrintf.output_zero_point;
37 const int32_t vkernel_zero_point = params->fp32_scalar_lrintf.kernel_zero_point;
38 do {
39 const uint8_t* i0 = input[0];
40 assert(i0 != NULL);
41 if XNN_UNPREDICTABLE(i0 != zero) {
42 i0 = (const uint8_t*) ((uintptr_t) i0 + input_offset);
43 }
44 const uint8_t* i1 = input[1];
45 assert(i1 != NULL);
46 if XNN_UNPREDICTABLE(i1 != zero) {
47 i1 = (const uint8_t*) ((uintptr_t) i1 + input_offset);
48 }
49 const uint8_t* i2 = input[2];
50 assert(i2 != NULL);
51 if XNN_UNPREDICTABLE(i2 != zero) {
52 i2 = (const uint8_t*) ((uintptr_t) i2 + input_offset);
53 }
54 const uint8_t* i3 = input[3];
55 assert(i3 != NULL);
56 if XNN_UNPREDICTABLE(i3 != zero) {
57 i3 = (const uint8_t*) ((uintptr_t) i3 + input_offset);
58 }
59 const uint8_t* i4 = input[4];
60 assert(i4 != NULL);
61 if XNN_UNPREDICTABLE(i4 != zero) {
62 i4 = (const uint8_t*) ((uintptr_t) i4 + input_offset);
63 }
64 const uint8_t* i5 = input[5];
65 assert(i5 != NULL);
66 if XNN_UNPREDICTABLE(i5 != zero) {
67 i5 = (const uint8_t*) ((uintptr_t) i5 + input_offset);
68 }
69 const uint8_t* i6 = input[6];
70 assert(i6 != NULL);
71 if XNN_UNPREDICTABLE(i6 != zero) {
72 i6 = (const uint8_t*) ((uintptr_t) i6 + input_offset);
73 }
74 const uint8_t* i7 = input[7];
75 assert(i7 != NULL);
76 if XNN_UNPREDICTABLE(i7 != zero) {
77 i7 = (const uint8_t*) ((uintptr_t) i7 + input_offset);
78 }
79 const uint8_t* i8 = input[8];
80 assert(i8 != NULL);
81 if XNN_UNPREDICTABLE(i8 != zero) {
82 i8 = (const uint8_t*) ((uintptr_t) i8 + input_offset);
83 }
84 const uint8_t* i9 = input[9];
85 assert(i9 != NULL);
86 if XNN_UNPREDICTABLE(i9 != zero) {
87 i9 = (const uint8_t*) ((uintptr_t) i9 + input_offset);
88 }
89 const uint8_t* i10 = input[10];
90 assert(i10 != NULL);
91 if XNN_UNPREDICTABLE(i10 != zero) {
92 i10 = (const uint8_t*) ((uintptr_t) i10 + input_offset);
93 }
94 const uint8_t* i11 = input[11];
95 assert(i11 != NULL);
96 if XNN_UNPREDICTABLE(i11 != zero) {
97 i11 = (const uint8_t*) ((uintptr_t) i11 + input_offset);
98 }
99 const uint8_t* i12 = input[12];
100 assert(i12 != NULL);
101 if XNN_UNPREDICTABLE(i12 != zero) {
102 i12 = (const uint8_t*) ((uintptr_t) i12 + input_offset);
103 }
104 const uint8_t* i13 = input[13];
105 assert(i13 != NULL);
106 if XNN_UNPREDICTABLE(i13 != zero) {
107 i13 = (const uint8_t*) ((uintptr_t) i13 + input_offset);
108 }
109 const uint8_t* i14 = input[14];
110 assert(i14 != NULL);
111 if XNN_UNPREDICTABLE(i14 != zero) {
112 i14 = (const uint8_t*) ((uintptr_t) i14 + input_offset);
113 }
114 const uint8_t* i15 = input[15];
115 assert(i15 != NULL);
116 if XNN_UNPREDICTABLE(i15 != zero) {
117 i15 = (const uint8_t*) ((uintptr_t) i15 + input_offset);
118 }
119 const uint8_t* i16 = input[16];
120 assert(i16 != NULL);
121 if XNN_UNPREDICTABLE(i16 != zero) {
122 i16 = (const uint8_t*) ((uintptr_t) i16 + input_offset);
123 }
124 const uint8_t* i17 = input[17];
125 assert(i17 != NULL);
126 if XNN_UNPREDICTABLE(i17 != zero) {
127 i17 = (const uint8_t*) ((uintptr_t) i17 + input_offset);
128 }
129 const uint8_t* i18 = input[18];
130 assert(i18 != NULL);
131 if XNN_UNPREDICTABLE(i18 != zero) {
132 i18 = (const uint8_t*) ((uintptr_t) i18 + input_offset);
133 }
134 const uint8_t* i19 = input[19];
135 assert(i19 != NULL);
136 if XNN_UNPREDICTABLE(i19 != zero) {
137 i19 = (const uint8_t*) ((uintptr_t) i19 + input_offset);
138 }
139 const uint8_t* i20 = input[20];
140 assert(i20 != NULL);
141 if XNN_UNPREDICTABLE(i20 != zero) {
142 i20 = (const uint8_t*) ((uintptr_t) i20 + input_offset);
143 }
144 const uint8_t* i21 = input[21];
145 assert(i21 != NULL);
146 if XNN_UNPREDICTABLE(i21 != zero) {
147 i21 = (const uint8_t*) ((uintptr_t) i21 + input_offset);
148 }
149 const uint8_t* i22 = input[22];
150 assert(i22 != NULL);
151 if XNN_UNPREDICTABLE(i22 != zero) {
152 i22 = (const uint8_t*) ((uintptr_t) i22 + input_offset);
153 }
154 const uint8_t* i23 = input[23];
155 assert(i23 != NULL);
156 if XNN_UNPREDICTABLE(i23 != zero) {
157 i23 = (const uint8_t*) ((uintptr_t) i23 + input_offset);
158 }
159 const uint8_t* i24 = input[24];
160 assert(i24 != NULL);
161 if XNN_UNPREDICTABLE(i24 != zero) {
162 i24 = (const uint8_t*) ((uintptr_t) i24 + input_offset);
163 }
164 input = (const uint8_t**) ((uintptr_t) input + input_stride);
165
166 size_t c = channels;
167 const void* w = weights;
168 for (; c >= 2; c -= 2) {
169 int32_t vacc0 = unaligned_indexed_load_s32(w, 0);
170 int32_t vacc1 = unaligned_indexed_load_s32(w, 1);
171
172
173 const int32_t vi0x0 = (int32_t) (uint32_t) i0[0];
174 const int32_t vi0x1 = (int32_t) (uint32_t) i0[1];
175 i0 += 2;
176
177 const int32_t vk0x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[0] - vkernel_zero_point;
178 const int32_t vk0x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[1] - vkernel_zero_point;
179
180 vacc0 += vi0x0 * vk0x0;
181 vacc1 += vi0x1 * vk0x1;
182
183 const int32_t vi1x0 = (int32_t) (uint32_t) i1[0];
184 const int32_t vi1x1 = (int32_t) (uint32_t) i1[1];
185 i1 += 2;
186
187 const int32_t vk1x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[2] - vkernel_zero_point;
188 const int32_t vk1x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[3] - vkernel_zero_point;
189
190 vacc0 += vi1x0 * vk1x0;
191 vacc1 += vi1x1 * vk1x1;
192
193 const int32_t vi2x0 = (int32_t) (uint32_t) i2[0];
194 const int32_t vi2x1 = (int32_t) (uint32_t) i2[1];
195 i2 += 2;
196
197 const int32_t vk2x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[4] - vkernel_zero_point;
198 const int32_t vk2x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[5] - vkernel_zero_point;
199
200 vacc0 += vi2x0 * vk2x0;
201 vacc1 += vi2x1 * vk2x1;
202
203 const int32_t vi3x0 = (int32_t) (uint32_t) i3[0];
204 const int32_t vi3x1 = (int32_t) (uint32_t) i3[1];
205 i3 += 2;
206
207 const int32_t vk3x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[6] - vkernel_zero_point;
208 const int32_t vk3x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[7] - vkernel_zero_point;
209
210 vacc0 += vi3x0 * vk3x0;
211 vacc1 += vi3x1 * vk3x1;
212
213 const int32_t vi4x0 = (int32_t) (uint32_t) i4[0];
214 const int32_t vi4x1 = (int32_t) (uint32_t) i4[1];
215 i4 += 2;
216
217 const int32_t vk4x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[8] - vkernel_zero_point;
218 const int32_t vk4x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[9] - vkernel_zero_point;
219
220 vacc0 += vi4x0 * vk4x0;
221 vacc1 += vi4x1 * vk4x1;
222
223 const int32_t vi5x0 = (int32_t) (uint32_t) i5[0];
224 const int32_t vi5x1 = (int32_t) (uint32_t) i5[1];
225 i5 += 2;
226
227 const int32_t vk5x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[10] - vkernel_zero_point;
228 const int32_t vk5x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[11] - vkernel_zero_point;
229
230 vacc0 += vi5x0 * vk5x0;
231 vacc1 += vi5x1 * vk5x1;
232
233 const int32_t vi6x0 = (int32_t) (uint32_t) i6[0];
234 const int32_t vi6x1 = (int32_t) (uint32_t) i6[1];
235 i6 += 2;
236
237 const int32_t vk6x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[12] - vkernel_zero_point;
238 const int32_t vk6x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[13] - vkernel_zero_point;
239
240 vacc0 += vi6x0 * vk6x0;
241 vacc1 += vi6x1 * vk6x1;
242
243 const int32_t vi7x0 = (int32_t) (uint32_t) i7[0];
244 const int32_t vi7x1 = (int32_t) (uint32_t) i7[1];
245 i7 += 2;
246
247 const int32_t vk7x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[14] - vkernel_zero_point;
248 const int32_t vk7x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[15] - vkernel_zero_point;
249
250 vacc0 += vi7x0 * vk7x0;
251 vacc1 += vi7x1 * vk7x1;
252
253 const int32_t vi8x0 = (int32_t) (uint32_t) i8[0];
254 const int32_t vi8x1 = (int32_t) (uint32_t) i8[1];
255 i8 += 2;
256
257 const int32_t vk8x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[16] - vkernel_zero_point;
258 const int32_t vk8x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[17] - vkernel_zero_point;
259
260 vacc0 += vi8x0 * vk8x0;
261 vacc1 += vi8x1 * vk8x1;
262
263 const int32_t vi9x0 = (int32_t) (uint32_t) i9[0];
264 const int32_t vi9x1 = (int32_t) (uint32_t) i9[1];
265 i9 += 2;
266
267 const int32_t vk9x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[18] - vkernel_zero_point;
268 const int32_t vk9x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[19] - vkernel_zero_point;
269
270 vacc0 += vi9x0 * vk9x0;
271 vacc1 += vi9x1 * vk9x1;
272
273 const int32_t vi10x0 = (int32_t) (uint32_t) i10[0];
274 const int32_t vi10x1 = (int32_t) (uint32_t) i10[1];
275 i10 += 2;
276
277 const int32_t vk10x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[20] - vkernel_zero_point;
278 const int32_t vk10x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[21] - vkernel_zero_point;
279
280 vacc0 += vi10x0 * vk10x0;
281 vacc1 += vi10x1 * vk10x1;
282
283 const int32_t vi11x0 = (int32_t) (uint32_t) i11[0];
284 const int32_t vi11x1 = (int32_t) (uint32_t) i11[1];
285 i11 += 2;
286
287 const int32_t vk11x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[22] - vkernel_zero_point;
288 const int32_t vk11x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[23] - vkernel_zero_point;
289
290 vacc0 += vi11x0 * vk11x0;
291 vacc1 += vi11x1 * vk11x1;
292
293 const int32_t vi12x0 = (int32_t) (uint32_t) i12[0];
294 const int32_t vi12x1 = (int32_t) (uint32_t) i12[1];
295 i12 += 2;
296
297 const int32_t vk12x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[24] - vkernel_zero_point;
298 const int32_t vk12x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[25] - vkernel_zero_point;
299
300 vacc0 += vi12x0 * vk12x0;
301 vacc1 += vi12x1 * vk12x1;
302
303 const int32_t vi13x0 = (int32_t) (uint32_t) i13[0];
304 const int32_t vi13x1 = (int32_t) (uint32_t) i13[1];
305 i13 += 2;
306
307 const int32_t vk13x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[26] - vkernel_zero_point;
308 const int32_t vk13x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[27] - vkernel_zero_point;
309
310 vacc0 += vi13x0 * vk13x0;
311 vacc1 += vi13x1 * vk13x1;
312
313 const int32_t vi14x0 = (int32_t) (uint32_t) i14[0];
314 const int32_t vi14x1 = (int32_t) (uint32_t) i14[1];
315 i14 += 2;
316
317 const int32_t vk14x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[28] - vkernel_zero_point;
318 const int32_t vk14x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[29] - vkernel_zero_point;
319
320 vacc0 += vi14x0 * vk14x0;
321 vacc1 += vi14x1 * vk14x1;
322
323 const int32_t vi15x0 = (int32_t) (uint32_t) i15[0];
324 const int32_t vi15x1 = (int32_t) (uint32_t) i15[1];
325 i15 += 2;
326
327 const int32_t vk15x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[30] - vkernel_zero_point;
328 const int32_t vk15x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[31] - vkernel_zero_point;
329
330 vacc0 += vi15x0 * vk15x0;
331 vacc1 += vi15x1 * vk15x1;
332
333 const int32_t vi16x0 = (int32_t) (uint32_t) i16[0];
334 const int32_t vi16x1 = (int32_t) (uint32_t) i16[1];
335 i16 += 2;
336
337 const int32_t vk16x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[32] - vkernel_zero_point;
338 const int32_t vk16x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[33] - vkernel_zero_point;
339
340 vacc0 += vi16x0 * vk16x0;
341 vacc1 += vi16x1 * vk16x1;
342
343 const int32_t vi17x0 = (int32_t) (uint32_t) i17[0];
344 const int32_t vi17x1 = (int32_t) (uint32_t) i17[1];
345 i17 += 2;
346
347 const int32_t vk17x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[34] - vkernel_zero_point;
348 const int32_t vk17x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[35] - vkernel_zero_point;
349
350 vacc0 += vi17x0 * vk17x0;
351 vacc1 += vi17x1 * vk17x1;
352
353 const int32_t vi18x0 = (int32_t) (uint32_t) i18[0];
354 const int32_t vi18x1 = (int32_t) (uint32_t) i18[1];
355 i18 += 2;
356
357 const int32_t vk18x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[36] - vkernel_zero_point;
358 const int32_t vk18x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[37] - vkernel_zero_point;
359
360 vacc0 += vi18x0 * vk18x0;
361 vacc1 += vi18x1 * vk18x1;
362
363 const int32_t vi19x0 = (int32_t) (uint32_t) i19[0];
364 const int32_t vi19x1 = (int32_t) (uint32_t) i19[1];
365 i19 += 2;
366
367 const int32_t vk19x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[38] - vkernel_zero_point;
368 const int32_t vk19x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[39] - vkernel_zero_point;
369
370 vacc0 += vi19x0 * vk19x0;
371 vacc1 += vi19x1 * vk19x1;
372
373 const int32_t vi20x0 = (int32_t) (uint32_t) i20[0];
374 const int32_t vi20x1 = (int32_t) (uint32_t) i20[1];
375 i20 += 2;
376
377 const int32_t vk20x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[40] - vkernel_zero_point;
378 const int32_t vk20x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[41] - vkernel_zero_point;
379
380 vacc0 += vi20x0 * vk20x0;
381 vacc1 += vi20x1 * vk20x1;
382
383 const int32_t vi21x0 = (int32_t) (uint32_t) i21[0];
384 const int32_t vi21x1 = (int32_t) (uint32_t) i21[1];
385 i21 += 2;
386
387 const int32_t vk21x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[42] - vkernel_zero_point;
388 const int32_t vk21x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[43] - vkernel_zero_point;
389
390 vacc0 += vi21x0 * vk21x0;
391 vacc1 += vi21x1 * vk21x1;
392
393 const int32_t vi22x0 = (int32_t) (uint32_t) i22[0];
394 const int32_t vi22x1 = (int32_t) (uint32_t) i22[1];
395 i22 += 2;
396
397 const int32_t vk22x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[44] - vkernel_zero_point;
398 const int32_t vk22x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[45] - vkernel_zero_point;
399
400 vacc0 += vi22x0 * vk22x0;
401 vacc1 += vi22x1 * vk22x1;
402
403 const int32_t vi23x0 = (int32_t) (uint32_t) i23[0];
404 const int32_t vi23x1 = (int32_t) (uint32_t) i23[1];
405 i23 += 2;
406
407 const int32_t vk23x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[46] - vkernel_zero_point;
408 const int32_t vk23x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[47] - vkernel_zero_point;
409
410 vacc0 += vi23x0 * vk23x0;
411 vacc1 += vi23x1 * vk23x1;
412
413 const int32_t vi24x0 = (int32_t) (uint32_t) i24[0];
414 const int32_t vi24x1 = (int32_t) (uint32_t) i24[1];
415 i24 += 2;
416
417 const int32_t vk24x0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[48] - vkernel_zero_point;
418 const int32_t vk24x1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[49] - vkernel_zero_point;
419
420 vacc0 += vi24x0 * vk24x0;
421 vacc1 += vi24x1 * vk24x1;
422
423 w = (const void*) ((uintptr_t) w + 2 * sizeof(int32_t) + 50 * sizeof(uint8_t));
424
425 float vfpacc0 = (float) vacc0;
426 float vfpacc1 = (float) vacc1;
427
428 vfpacc0 *= vscale;
429 vfpacc1 *= vscale;
430
431 vfpacc0 = math_max_f32(vfpacc0, voutput_min_less_zero_point);
432 vfpacc1 = math_max_f32(vfpacc1, voutput_min_less_zero_point);
433
434 vfpacc0 = math_min_f32(vfpacc0, voutput_max_less_zero_point);
435 vfpacc1 = math_min_f32(vfpacc1, voutput_max_less_zero_point);
436
437 const int32_t vrndacc0 = (int32_t) lrintf(vfpacc0);
438 const int32_t vrndacc1 = (int32_t) lrintf(vfpacc1);
439
440 int32_t vout0 = (int32_t) vrndacc0 + voutput_zero_point;
441 int32_t vout1 = (int32_t) vrndacc1 + voutput_zero_point;
442
443 output[0] = (uint8_t) vout0;
444 output[1] = (uint8_t) vout1;
445 output += 2;
446 }
447 if XNN_UNLIKELY(c != 0) {
448 int32_t vacc = unaligned_load_s32(w);
449
450 const int32_t vi0 = (int32_t) (uint32_t) *i0;
451 const int32_t vk0 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[0] - vkernel_zero_point;
452 vacc += vi0 * vk0;
453 const int32_t vi1 = (int32_t) (uint32_t) *i1;
454 const int32_t vk1 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[2] - vkernel_zero_point;
455 vacc += vi1 * vk1;
456 const int32_t vi2 = (int32_t) (uint32_t) *i2;
457 const int32_t vk2 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[4] - vkernel_zero_point;
458 vacc += vi2 * vk2;
459 const int32_t vi3 = (int32_t) (uint32_t) *i3;
460 const int32_t vk3 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[6] - vkernel_zero_point;
461 vacc += vi3 * vk3;
462 const int32_t vi4 = (int32_t) (uint32_t) *i4;
463 const int32_t vk4 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[8] - vkernel_zero_point;
464 vacc += vi4 * vk4;
465 const int32_t vi5 = (int32_t) (uint32_t) *i5;
466 const int32_t vk5 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[10] - vkernel_zero_point;
467 vacc += vi5 * vk5;
468 const int32_t vi6 = (int32_t) (uint32_t) *i6;
469 const int32_t vk6 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[12] - vkernel_zero_point;
470 vacc += vi6 * vk6;
471 const int32_t vi7 = (int32_t) (uint32_t) *i7;
472 const int32_t vk7 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[14] - vkernel_zero_point;
473 vacc += vi7 * vk7;
474 const int32_t vi8 = (int32_t) (uint32_t) *i8;
475 const int32_t vk8 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[16] - vkernel_zero_point;
476 vacc += vi8 * vk8;
477 const int32_t vi9 = (int32_t) (uint32_t) *i9;
478 const int32_t vk9 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[18] - vkernel_zero_point;
479 vacc += vi9 * vk9;
480 const int32_t vi10 = (int32_t) (uint32_t) *i10;
481 const int32_t vk10 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[20] - vkernel_zero_point;
482 vacc += vi10 * vk10;
483 const int32_t vi11 = (int32_t) (uint32_t) *i11;
484 const int32_t vk11 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[22] - vkernel_zero_point;
485 vacc += vi11 * vk11;
486 const int32_t vi12 = (int32_t) (uint32_t) *i12;
487 const int32_t vk12 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[24] - vkernel_zero_point;
488 vacc += vi12 * vk12;
489 const int32_t vi13 = (int32_t) (uint32_t) *i13;
490 const int32_t vk13 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[26] - vkernel_zero_point;
491 vacc += vi13 * vk13;
492 const int32_t vi14 = (int32_t) (uint32_t) *i14;
493 const int32_t vk14 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[28] - vkernel_zero_point;
494 vacc += vi14 * vk14;
495 const int32_t vi15 = (int32_t) (uint32_t) *i15;
496 const int32_t vk15 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[30] - vkernel_zero_point;
497 vacc += vi15 * vk15;
498 const int32_t vi16 = (int32_t) (uint32_t) *i16;
499 const int32_t vk16 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[32] - vkernel_zero_point;
500 vacc += vi16 * vk16;
501 const int32_t vi17 = (int32_t) (uint32_t) *i17;
502 const int32_t vk17 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[34] - vkernel_zero_point;
503 vacc += vi17 * vk17;
504 const int32_t vi18 = (int32_t) (uint32_t) *i18;
505 const int32_t vk18 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[36] - vkernel_zero_point;
506 vacc += vi18 * vk18;
507 const int32_t vi19 = (int32_t) (uint32_t) *i19;
508 const int32_t vk19 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[38] - vkernel_zero_point;
509 vacc += vi19 * vk19;
510 const int32_t vi20 = (int32_t) (uint32_t) *i20;
511 const int32_t vk20 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[40] - vkernel_zero_point;
512 vacc += vi20 * vk20;
513 const int32_t vi21 = (int32_t) (uint32_t) *i21;
514 const int32_t vk21 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[42] - vkernel_zero_point;
515 vacc += vi21 * vk21;
516 const int32_t vi22 = (int32_t) (uint32_t) *i22;
517 const int32_t vk22 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[44] - vkernel_zero_point;
518 vacc += vi22 * vk22;
519 const int32_t vi23 = (int32_t) (uint32_t) *i23;
520 const int32_t vk23 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[46] - vkernel_zero_point;
521 vacc += vi23 * vk23;
522 const int32_t vi24 = (int32_t) (uint32_t) *i24;
523 const int32_t vk24 = (int32_t) (uint32_t) ((const uint8_t*) ((uintptr_t) w + 2 * sizeof(int32_t)))[48] - vkernel_zero_point;
524 vacc += vi24 * vk24;
525
526 float vfpacc = (float) vacc * vscale;
527
528 vfpacc = math_max_f32(vfpacc, voutput_min_less_zero_point);
529 vfpacc = math_min_f32(vfpacc, voutput_max_less_zero_point);
530 const int32_t vrndacc = (int32_t) lrintf(vfpacc);
531 int32_t vout = vrndacc + voutput_zero_point;
532
533 *output++ = (uint8_t) vout;
534 }
535
536 output = (uint8_t*) ((uintptr_t) output + output_increment);
537 } while (--output_width != 0);
538 }
539