1 // Auto-generated file. Do not edit!
2 // Template: src/f32-dwconv/up-wasmsimd.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 <wasm_simd128.h>
13
14 #include <xnnpack/dwconv.h>
15
16
xnn_f32_dwconv_minmax_ukernel_up8x25__wasmsimd_x86(size_t channels,size_t output_width,const float ** input,const float * weights,float * output,size_t input_stride,size_t output_increment,size_t input_offset,const float * zero,const union xnn_f32_minmax_params params[restrict XNN_MIN_ELEMENTS (1)])17 void xnn_f32_dwconv_minmax_ukernel_up8x25__wasmsimd_x86(
18 size_t channels,
19 size_t output_width,
20 const float** input,
21 const float* weights,
22 float* output,
23 size_t input_stride,
24 size_t output_increment,
25 size_t input_offset,
26 const float* zero,
27 const union xnn_f32_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_DISABLE_TSAN
28 {
29 assert(channels != 0);
30 assert(output_width != 0);
31
32 const v128_t vmin = wasm_v32x4_load_splat(¶ms->scalar.min);
33 const v128_t vmax = wasm_v32x4_load_splat(¶ms->scalar.max);
34 do {
35 const float* i0 = input[0];
36 assert(i0 != NULL);
37 if XNN_UNPREDICTABLE(i0 != zero) {
38 i0 = (const float*) ((uintptr_t) i0 + input_offset);
39 }
40 const float* i1 = input[1];
41 assert(i1 != NULL);
42 if XNN_UNPREDICTABLE(i1 != zero) {
43 i1 = (const float*) ((uintptr_t) i1 + input_offset);
44 }
45 const float* i2 = input[2];
46 assert(i2 != NULL);
47 if XNN_UNPREDICTABLE(i2 != zero) {
48 i2 = (const float*) ((uintptr_t) i2 + input_offset);
49 }
50 const float* i3 = input[3];
51 assert(i3 != NULL);
52 if XNN_UNPREDICTABLE(i3 != zero) {
53 i3 = (const float*) ((uintptr_t) i3 + input_offset);
54 }
55 const float* i4 = input[4];
56 assert(i4 != NULL);
57 if XNN_UNPREDICTABLE(i4 != zero) {
58 i4 = (const float*) ((uintptr_t) i4 + input_offset);
59 }
60 const float* i5 = input[5];
61 assert(i5 != NULL);
62 if XNN_UNPREDICTABLE(i5 != zero) {
63 i5 = (const float*) ((uintptr_t) i5 + input_offset);
64 }
65 const float* i6 = input[6];
66 assert(i6 != NULL);
67 if XNN_UNPREDICTABLE(i6 != zero) {
68 i6 = (const float*) ((uintptr_t) i6 + input_offset);
69 }
70 const float* i7 = input[7];
71 assert(i7 != NULL);
72 if XNN_UNPREDICTABLE(i7 != zero) {
73 i7 = (const float*) ((uintptr_t) i7 + input_offset);
74 }
75 const float* i8 = input[8];
76 assert(i8 != NULL);
77 if XNN_UNPREDICTABLE(i8 != zero) {
78 i8 = (const float*) ((uintptr_t) i8 + input_offset);
79 }
80 const float* i9 = input[9];
81 assert(i9 != NULL);
82 if XNN_UNPREDICTABLE(i9 != zero) {
83 i9 = (const float*) ((uintptr_t) i9 + input_offset);
84 }
85 const float* i10 = input[10];
86 assert(i10 != NULL);
87 if XNN_UNPREDICTABLE(i10 != zero) {
88 i10 = (const float*) ((uintptr_t) i10 + input_offset);
89 }
90 const float* i11 = input[11];
91 assert(i11 != NULL);
92 if XNN_UNPREDICTABLE(i11 != zero) {
93 i11 = (const float*) ((uintptr_t) i11 + input_offset);
94 }
95 const float* i12 = input[12];
96 assert(i12 != NULL);
97 if XNN_UNPREDICTABLE(i12 != zero) {
98 i12 = (const float*) ((uintptr_t) i12 + input_offset);
99 }
100 const float* i13 = input[13];
101 assert(i13 != NULL);
102 if XNN_UNPREDICTABLE(i13 != zero) {
103 i13 = (const float*) ((uintptr_t) i13 + input_offset);
104 }
105 const float* i14 = input[14];
106 assert(i14 != NULL);
107 if XNN_UNPREDICTABLE(i14 != zero) {
108 i14 = (const float*) ((uintptr_t) i14 + input_offset);
109 }
110 const float* i15 = input[15];
111 assert(i15 != NULL);
112 if XNN_UNPREDICTABLE(i15 != zero) {
113 i15 = (const float*) ((uintptr_t) i15 + input_offset);
114 }
115 const float* i16 = input[16];
116 assert(i16 != NULL);
117 if XNN_UNPREDICTABLE(i16 != zero) {
118 i16 = (const float*) ((uintptr_t) i16 + input_offset);
119 }
120 const float* i17 = input[17];
121 assert(i17 != NULL);
122 if XNN_UNPREDICTABLE(i17 != zero) {
123 i17 = (const float*) ((uintptr_t) i17 + input_offset);
124 }
125 const float* i18 = input[18];
126 assert(i18 != NULL);
127 if XNN_UNPREDICTABLE(i18 != zero) {
128 i18 = (const float*) ((uintptr_t) i18 + input_offset);
129 }
130 const float* i19 = input[19];
131 assert(i19 != NULL);
132 if XNN_UNPREDICTABLE(i19 != zero) {
133 i19 = (const float*) ((uintptr_t) i19 + input_offset);
134 }
135 const float* i20 = input[20];
136 assert(i20 != NULL);
137 if XNN_UNPREDICTABLE(i20 != zero) {
138 i20 = (const float*) ((uintptr_t) i20 + input_offset);
139 }
140 const float* i21 = input[21];
141 assert(i21 != NULL);
142 if XNN_UNPREDICTABLE(i21 != zero) {
143 i21 = (const float*) ((uintptr_t) i21 + input_offset);
144 }
145 const float* i22 = input[22];
146 assert(i22 != NULL);
147 if XNN_UNPREDICTABLE(i22 != zero) {
148 i22 = (const float*) ((uintptr_t) i22 + input_offset);
149 }
150 const float* i23 = input[23];
151 assert(i23 != NULL);
152 if XNN_UNPREDICTABLE(i23 != zero) {
153 i23 = (const float*) ((uintptr_t) i23 + input_offset);
154 }
155 const float* i24 = input[24];
156 assert(i24 != NULL);
157 if XNN_UNPREDICTABLE(i24 != zero) {
158 i24 = (const float*) ((uintptr_t) i24 + input_offset);
159 }
160 input = (const float**) ((uintptr_t) input + input_stride);
161
162 size_t c = channels;
163 const float* w = weights;
164 for (; c >= 8; c -= 8) {
165 v128_t vacc0123p0 = wasm_v128_load(w);
166 v128_t vacc4567p0 = wasm_v128_load(w + 4);
167
168
169 const v128_t vi0x0123 = wasm_v128_load(i0);
170 const v128_t vi0x4567 = wasm_v128_load(i0 + 4);
171 i0 += 8;
172
173 const v128_t vk0x0123 = wasm_v128_load(w + 8);
174 const v128_t vk0x4567 = wasm_v128_load(w + 12);
175 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi0x0123, vk0x0123));
176 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi0x4567, vk0x4567));
177
178 const v128_t vi1x0123 = wasm_v128_load(i1);
179 const v128_t vi1x4567 = wasm_v128_load(i1 + 4);
180 i1 += 8;
181
182 const v128_t vk1x0123 = wasm_v128_load(w + 16);
183 const v128_t vk1x4567 = wasm_v128_load(w + 20);
184 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi1x0123, vk1x0123));
185 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi1x4567, vk1x4567));
186
187 const v128_t vi2x0123 = wasm_v128_load(i2);
188 const v128_t vi2x4567 = wasm_v128_load(i2 + 4);
189 i2 += 8;
190
191 const v128_t vk2x0123 = wasm_v128_load(w + 24);
192 const v128_t vk2x4567 = wasm_v128_load(w + 28);
193 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi2x0123, vk2x0123));
194 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi2x4567, vk2x4567));
195
196 const v128_t vi3x0123 = wasm_v128_load(i3);
197 const v128_t vi3x4567 = wasm_v128_load(i3 + 4);
198 i3 += 8;
199
200 const v128_t vk3x0123 = wasm_v128_load(w + 32);
201 const v128_t vk3x4567 = wasm_v128_load(w + 36);
202 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi3x0123, vk3x0123));
203 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi3x4567, vk3x4567));
204
205 const v128_t vi4x0123 = wasm_v128_load(i4);
206 const v128_t vi4x4567 = wasm_v128_load(i4 + 4);
207 i4 += 8;
208
209 const v128_t vk4x0123 = wasm_v128_load(w + 40);
210 const v128_t vk4x4567 = wasm_v128_load(w + 44);
211 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi4x0123, vk4x0123));
212 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi4x4567, vk4x4567));
213
214 const v128_t vi5x0123 = wasm_v128_load(i5);
215 const v128_t vi5x4567 = wasm_v128_load(i5 + 4);
216 i5 += 8;
217
218 const v128_t vk5x0123 = wasm_v128_load(w + 48);
219 const v128_t vk5x4567 = wasm_v128_load(w + 52);
220 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi5x0123, vk5x0123));
221 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi5x4567, vk5x4567));
222
223 const v128_t vi6x0123 = wasm_v128_load(i6);
224 const v128_t vi6x4567 = wasm_v128_load(i6 + 4);
225 i6 += 8;
226
227 const v128_t vk6x0123 = wasm_v128_load(w + 56);
228 const v128_t vk6x4567 = wasm_v128_load(w + 60);
229 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi6x0123, vk6x0123));
230 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi6x4567, vk6x4567));
231
232 const v128_t vi7x0123 = wasm_v128_load(i7);
233 const v128_t vi7x4567 = wasm_v128_load(i7 + 4);
234 i7 += 8;
235
236 const v128_t vk7x0123 = wasm_v128_load(w + 64);
237 const v128_t vk7x4567 = wasm_v128_load(w + 68);
238 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi7x0123, vk7x0123));
239 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi7x4567, vk7x4567));
240
241 const v128_t vi8x0123 = wasm_v128_load(i8);
242 const v128_t vi8x4567 = wasm_v128_load(i8 + 4);
243 i8 += 8;
244
245 const v128_t vk8x0123 = wasm_v128_load(w + 72);
246 const v128_t vk8x4567 = wasm_v128_load(w + 76);
247 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi8x0123, vk8x0123));
248 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi8x4567, vk8x4567));
249
250 const v128_t vi9x0123 = wasm_v128_load(i9);
251 const v128_t vi9x4567 = wasm_v128_load(i9 + 4);
252 i9 += 8;
253
254 const v128_t vk9x0123 = wasm_v128_load(w + 80);
255 const v128_t vk9x4567 = wasm_v128_load(w + 84);
256 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi9x0123, vk9x0123));
257 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi9x4567, vk9x4567));
258
259 const v128_t vi10x0123 = wasm_v128_load(i10);
260 const v128_t vi10x4567 = wasm_v128_load(i10 + 4);
261 i10 += 8;
262
263 const v128_t vk10x0123 = wasm_v128_load(w + 88);
264 const v128_t vk10x4567 = wasm_v128_load(w + 92);
265 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi10x0123, vk10x0123));
266 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi10x4567, vk10x4567));
267
268 const v128_t vi11x0123 = wasm_v128_load(i11);
269 const v128_t vi11x4567 = wasm_v128_load(i11 + 4);
270 i11 += 8;
271
272 const v128_t vk11x0123 = wasm_v128_load(w + 96);
273 const v128_t vk11x4567 = wasm_v128_load(w + 100);
274 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi11x0123, vk11x0123));
275 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi11x4567, vk11x4567));
276
277 const v128_t vi12x0123 = wasm_v128_load(i12);
278 const v128_t vi12x4567 = wasm_v128_load(i12 + 4);
279 i12 += 8;
280
281 const v128_t vk12x0123 = wasm_v128_load(w + 104);
282 const v128_t vk12x4567 = wasm_v128_load(w + 108);
283 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi12x0123, vk12x0123));
284 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi12x4567, vk12x4567));
285
286 const v128_t vi13x0123 = wasm_v128_load(i13);
287 const v128_t vi13x4567 = wasm_v128_load(i13 + 4);
288 i13 += 8;
289
290 const v128_t vk13x0123 = wasm_v128_load(w + 112);
291 const v128_t vk13x4567 = wasm_v128_load(w + 116);
292 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi13x0123, vk13x0123));
293 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi13x4567, vk13x4567));
294
295 const v128_t vi14x0123 = wasm_v128_load(i14);
296 const v128_t vi14x4567 = wasm_v128_load(i14 + 4);
297 i14 += 8;
298
299 const v128_t vk14x0123 = wasm_v128_load(w + 120);
300 const v128_t vk14x4567 = wasm_v128_load(w + 124);
301 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi14x0123, vk14x0123));
302 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi14x4567, vk14x4567));
303
304 const v128_t vi15x0123 = wasm_v128_load(i15);
305 const v128_t vi15x4567 = wasm_v128_load(i15 + 4);
306 i15 += 8;
307
308 const v128_t vk15x0123 = wasm_v128_load(w + 128);
309 const v128_t vk15x4567 = wasm_v128_load(w + 132);
310 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi15x0123, vk15x0123));
311 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi15x4567, vk15x4567));
312
313 const v128_t vi16x0123 = wasm_v128_load(i16);
314 const v128_t vi16x4567 = wasm_v128_load(i16 + 4);
315 i16 += 8;
316
317 const v128_t vk16x0123 = wasm_v128_load(w + 136);
318 const v128_t vk16x4567 = wasm_v128_load(w + 140);
319 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi16x0123, vk16x0123));
320 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi16x4567, vk16x4567));
321
322 const v128_t vi17x0123 = wasm_v128_load(i17);
323 const v128_t vi17x4567 = wasm_v128_load(i17 + 4);
324 i17 += 8;
325
326 const v128_t vk17x0123 = wasm_v128_load(w + 144);
327 const v128_t vk17x4567 = wasm_v128_load(w + 148);
328 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi17x0123, vk17x0123));
329 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi17x4567, vk17x4567));
330
331 const v128_t vi18x0123 = wasm_v128_load(i18);
332 const v128_t vi18x4567 = wasm_v128_load(i18 + 4);
333 i18 += 8;
334
335 const v128_t vk18x0123 = wasm_v128_load(w + 152);
336 const v128_t vk18x4567 = wasm_v128_load(w + 156);
337 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi18x0123, vk18x0123));
338 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi18x4567, vk18x4567));
339
340 const v128_t vi19x0123 = wasm_v128_load(i19);
341 const v128_t vi19x4567 = wasm_v128_load(i19 + 4);
342 i19 += 8;
343
344 const v128_t vk19x0123 = wasm_v128_load(w + 160);
345 const v128_t vk19x4567 = wasm_v128_load(w + 164);
346 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi19x0123, vk19x0123));
347 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi19x4567, vk19x4567));
348
349 const v128_t vi20x0123 = wasm_v128_load(i20);
350 const v128_t vi20x4567 = wasm_v128_load(i20 + 4);
351 i20 += 8;
352
353 const v128_t vk20x0123 = wasm_v128_load(w + 168);
354 const v128_t vk20x4567 = wasm_v128_load(w + 172);
355 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi20x0123, vk20x0123));
356 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi20x4567, vk20x4567));
357
358 const v128_t vi21x0123 = wasm_v128_load(i21);
359 const v128_t vi21x4567 = wasm_v128_load(i21 + 4);
360 i21 += 8;
361
362 const v128_t vk21x0123 = wasm_v128_load(w + 176);
363 const v128_t vk21x4567 = wasm_v128_load(w + 180);
364 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi21x0123, vk21x0123));
365 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi21x4567, vk21x4567));
366
367 const v128_t vi22x0123 = wasm_v128_load(i22);
368 const v128_t vi22x4567 = wasm_v128_load(i22 + 4);
369 i22 += 8;
370
371 const v128_t vk22x0123 = wasm_v128_load(w + 184);
372 const v128_t vk22x4567 = wasm_v128_load(w + 188);
373 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi22x0123, vk22x0123));
374 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi22x4567, vk22x4567));
375
376 const v128_t vi23x0123 = wasm_v128_load(i23);
377 const v128_t vi23x4567 = wasm_v128_load(i23 + 4);
378 i23 += 8;
379
380 const v128_t vk23x0123 = wasm_v128_load(w + 192);
381 const v128_t vk23x4567 = wasm_v128_load(w + 196);
382 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi23x0123, vk23x0123));
383 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi23x4567, vk23x4567));
384
385 const v128_t vi24x0123 = wasm_v128_load(i24);
386 const v128_t vi24x4567 = wasm_v128_load(i24 + 4);
387 i24 += 8;
388
389 const v128_t vk24x0123 = wasm_v128_load(w + 200);
390 const v128_t vk24x4567 = wasm_v128_load(w + 204);
391 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi24x0123, vk24x0123));
392 vacc4567p0 = wasm_f32x4_add(vacc4567p0, wasm_f32x4_mul(vi24x4567, vk24x4567));
393
394 w += 208;
395
396
397 v128_t vacc0123 = wasm_v128_bitselect(vmin, vacc0123p0, wasm_f32x4_lt(vacc0123p0, vmin));
398 v128_t vacc4567 = wasm_v128_bitselect(vmin, vacc4567p0, wasm_f32x4_lt(vacc4567p0, vmin));
399
400 vacc0123 = wasm_v128_bitselect(vacc0123, vmax, wasm_f32x4_le(vacc0123, vmax));
401 vacc4567 = wasm_v128_bitselect(vacc4567, vmax, wasm_f32x4_le(vacc4567, vmax));
402
403 wasm_v128_store(output, vacc0123);
404 wasm_v128_store(output + 4, vacc4567);
405 output += 8;
406 }
407 for (; c >= 4; c -= 4) {
408 v128_t vacc0123p0 = wasm_v128_load(w);
409
410 const v128_t vi0x0123 = wasm_v128_load(i0);
411 i0 += 4;
412
413 const v128_t vk0x0123 = wasm_v128_load(w + 8);
414 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi0x0123, vk0x0123));
415
416 const v128_t vi1x0123 = wasm_v128_load(i1);
417 i1 += 4;
418
419 const v128_t vk1x0123 = wasm_v128_load(w + 16);
420 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi1x0123, vk1x0123));
421
422 const v128_t vi2x0123 = wasm_v128_load(i2);
423 i2 += 4;
424
425 const v128_t vk2x0123 = wasm_v128_load(w + 24);
426 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi2x0123, vk2x0123));
427
428 const v128_t vi3x0123 = wasm_v128_load(i3);
429 i3 += 4;
430
431 const v128_t vk3x0123 = wasm_v128_load(w + 32);
432 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi3x0123, vk3x0123));
433
434 const v128_t vi4x0123 = wasm_v128_load(i4);
435 i4 += 4;
436
437 const v128_t vk4x0123 = wasm_v128_load(w + 40);
438 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi4x0123, vk4x0123));
439
440 const v128_t vi5x0123 = wasm_v128_load(i5);
441 i5 += 4;
442
443 const v128_t vk5x0123 = wasm_v128_load(w + 48);
444 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi5x0123, vk5x0123));
445
446 const v128_t vi6x0123 = wasm_v128_load(i6);
447 i6 += 4;
448
449 const v128_t vk6x0123 = wasm_v128_load(w + 56);
450 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi6x0123, vk6x0123));
451
452 const v128_t vi7x0123 = wasm_v128_load(i7);
453 i7 += 4;
454
455 const v128_t vk7x0123 = wasm_v128_load(w + 64);
456 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi7x0123, vk7x0123));
457
458 const v128_t vi8x0123 = wasm_v128_load(i8);
459 i8 += 4;
460
461 const v128_t vk8x0123 = wasm_v128_load(w + 72);
462 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi8x0123, vk8x0123));
463
464 const v128_t vi9x0123 = wasm_v128_load(i9);
465 i9 += 4;
466
467 const v128_t vk9x0123 = wasm_v128_load(w + 80);
468 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi9x0123, vk9x0123));
469
470 const v128_t vi10x0123 = wasm_v128_load(i10);
471 i10 += 4;
472
473 const v128_t vk10x0123 = wasm_v128_load(w + 88);
474 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi10x0123, vk10x0123));
475
476 const v128_t vi11x0123 = wasm_v128_load(i11);
477 i11 += 4;
478
479 const v128_t vk11x0123 = wasm_v128_load(w + 96);
480 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi11x0123, vk11x0123));
481
482 const v128_t vi12x0123 = wasm_v128_load(i12);
483 i12 += 4;
484
485 const v128_t vk12x0123 = wasm_v128_load(w + 104);
486 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi12x0123, vk12x0123));
487
488 const v128_t vi13x0123 = wasm_v128_load(i13);
489 i13 += 4;
490
491 const v128_t vk13x0123 = wasm_v128_load(w + 112);
492 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi13x0123, vk13x0123));
493
494 const v128_t vi14x0123 = wasm_v128_load(i14);
495 i14 += 4;
496
497 const v128_t vk14x0123 = wasm_v128_load(w + 120);
498 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi14x0123, vk14x0123));
499
500 const v128_t vi15x0123 = wasm_v128_load(i15);
501 i15 += 4;
502
503 const v128_t vk15x0123 = wasm_v128_load(w + 128);
504 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi15x0123, vk15x0123));
505
506 const v128_t vi16x0123 = wasm_v128_load(i16);
507 i16 += 4;
508
509 const v128_t vk16x0123 = wasm_v128_load(w + 136);
510 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi16x0123, vk16x0123));
511
512 const v128_t vi17x0123 = wasm_v128_load(i17);
513 i17 += 4;
514
515 const v128_t vk17x0123 = wasm_v128_load(w + 144);
516 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi17x0123, vk17x0123));
517
518 const v128_t vi18x0123 = wasm_v128_load(i18);
519 i18 += 4;
520
521 const v128_t vk18x0123 = wasm_v128_load(w + 152);
522 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi18x0123, vk18x0123));
523
524 const v128_t vi19x0123 = wasm_v128_load(i19);
525 i19 += 4;
526
527 const v128_t vk19x0123 = wasm_v128_load(w + 160);
528 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi19x0123, vk19x0123));
529
530 const v128_t vi20x0123 = wasm_v128_load(i20);
531 i20 += 4;
532
533 const v128_t vk20x0123 = wasm_v128_load(w + 168);
534 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi20x0123, vk20x0123));
535
536 const v128_t vi21x0123 = wasm_v128_load(i21);
537 i21 += 4;
538
539 const v128_t vk21x0123 = wasm_v128_load(w + 176);
540 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi21x0123, vk21x0123));
541
542 const v128_t vi22x0123 = wasm_v128_load(i22);
543 i22 += 4;
544
545 const v128_t vk22x0123 = wasm_v128_load(w + 184);
546 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi22x0123, vk22x0123));
547
548 const v128_t vi23x0123 = wasm_v128_load(i23);
549 i23 += 4;
550
551 const v128_t vk23x0123 = wasm_v128_load(w + 192);
552 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi23x0123, vk23x0123));
553
554 const v128_t vi24x0123 = wasm_v128_load(i24);
555 i24 += 4;
556
557 const v128_t vk24x0123 = wasm_v128_load(w + 200);
558 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi24x0123, vk24x0123));
559
560 w += 4;
561
562
563 v128_t vacc0123 = wasm_v128_bitselect(vmin, vacc0123p0, wasm_f32x4_lt(vacc0123p0, vmin));
564 vacc0123 = wasm_v128_bitselect(vacc0123, vmax, wasm_f32x4_le(vacc0123, vmax));
565
566 wasm_v128_store(output, vacc0123);
567 output += 4;
568 }
569 if XNN_UNLIKELY(c != 0) {
570 v128_t vacc0123p0 = wasm_v128_load(w);
571
572 const v128_t vi0x0123 = wasm_v128_load(i0);
573 const v128_t vk0x0123 = wasm_v128_load(w + 8);
574 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi0x0123, vk0x0123));
575
576 const v128_t vi1x0123 = wasm_v128_load(i1);
577 const v128_t vk1x0123 = wasm_v128_load(w + 16);
578 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi1x0123, vk1x0123));
579
580 const v128_t vi2x0123 = wasm_v128_load(i2);
581 const v128_t vk2x0123 = wasm_v128_load(w + 24);
582 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi2x0123, vk2x0123));
583
584 const v128_t vi3x0123 = wasm_v128_load(i3);
585 const v128_t vk3x0123 = wasm_v128_load(w + 32);
586 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi3x0123, vk3x0123));
587
588 const v128_t vi4x0123 = wasm_v128_load(i4);
589 const v128_t vk4x0123 = wasm_v128_load(w + 40);
590 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi4x0123, vk4x0123));
591
592 const v128_t vi5x0123 = wasm_v128_load(i5);
593 const v128_t vk5x0123 = wasm_v128_load(w + 48);
594 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi5x0123, vk5x0123));
595
596 const v128_t vi6x0123 = wasm_v128_load(i6);
597 const v128_t vk6x0123 = wasm_v128_load(w + 56);
598 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi6x0123, vk6x0123));
599
600 const v128_t vi7x0123 = wasm_v128_load(i7);
601 const v128_t vk7x0123 = wasm_v128_load(w + 64);
602 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi7x0123, vk7x0123));
603
604 const v128_t vi8x0123 = wasm_v128_load(i8);
605 const v128_t vk8x0123 = wasm_v128_load(w + 72);
606 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi8x0123, vk8x0123));
607
608 const v128_t vi9x0123 = wasm_v128_load(i9);
609 const v128_t vk9x0123 = wasm_v128_load(w + 80);
610 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi9x0123, vk9x0123));
611
612 const v128_t vi10x0123 = wasm_v128_load(i10);
613 const v128_t vk10x0123 = wasm_v128_load(w + 88);
614 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi10x0123, vk10x0123));
615
616 const v128_t vi11x0123 = wasm_v128_load(i11);
617 const v128_t vk11x0123 = wasm_v128_load(w + 96);
618 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi11x0123, vk11x0123));
619
620 const v128_t vi12x0123 = wasm_v128_load(i12);
621 const v128_t vk12x0123 = wasm_v128_load(w + 104);
622 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi12x0123, vk12x0123));
623
624 const v128_t vi13x0123 = wasm_v128_load(i13);
625 const v128_t vk13x0123 = wasm_v128_load(w + 112);
626 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi13x0123, vk13x0123));
627
628 const v128_t vi14x0123 = wasm_v128_load(i14);
629 const v128_t vk14x0123 = wasm_v128_load(w + 120);
630 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi14x0123, vk14x0123));
631
632 const v128_t vi15x0123 = wasm_v128_load(i15);
633 const v128_t vk15x0123 = wasm_v128_load(w + 128);
634 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi15x0123, vk15x0123));
635
636 const v128_t vi16x0123 = wasm_v128_load(i16);
637 const v128_t vk16x0123 = wasm_v128_load(w + 136);
638 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi16x0123, vk16x0123));
639
640 const v128_t vi17x0123 = wasm_v128_load(i17);
641 const v128_t vk17x0123 = wasm_v128_load(w + 144);
642 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi17x0123, vk17x0123));
643
644 const v128_t vi18x0123 = wasm_v128_load(i18);
645 const v128_t vk18x0123 = wasm_v128_load(w + 152);
646 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi18x0123, vk18x0123));
647
648 const v128_t vi19x0123 = wasm_v128_load(i19);
649 const v128_t vk19x0123 = wasm_v128_load(w + 160);
650 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi19x0123, vk19x0123));
651
652 const v128_t vi20x0123 = wasm_v128_load(i20);
653 const v128_t vk20x0123 = wasm_v128_load(w + 168);
654 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi20x0123, vk20x0123));
655
656 const v128_t vi21x0123 = wasm_v128_load(i21);
657 const v128_t vk21x0123 = wasm_v128_load(w + 176);
658 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi21x0123, vk21x0123));
659
660 const v128_t vi22x0123 = wasm_v128_load(i22);
661 const v128_t vk22x0123 = wasm_v128_load(w + 184);
662 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi22x0123, vk22x0123));
663
664 const v128_t vi23x0123 = wasm_v128_load(i23);
665 const v128_t vk23x0123 = wasm_v128_load(w + 192);
666 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi23x0123, vk23x0123));
667
668 const v128_t vi24x0123 = wasm_v128_load(i24);
669 const v128_t vk24x0123 = wasm_v128_load(w + 200);
670 vacc0123p0 = wasm_f32x4_add(vacc0123p0, wasm_f32x4_mul(vi24x0123, vk24x0123));
671
672
673 v128_t vacc0123 = wasm_v128_bitselect(vmin, vacc0123p0, wasm_f32x4_lt(vacc0123p0, vmin));
674 vacc0123 = wasm_v128_bitselect(vacc0123, vmax, wasm_f32x4_le(vacc0123, vmax));
675
676 if (c & 2) {
677 *((double*) output) = wasm_f64x2_extract_lane(vacc0123, 0);
678 vacc0123 = wasm_v32x4_shuffle(vacc0123, vacc0123, 2, 3, 2, 3);
679 output += 2;
680 }
681 if (c & 1) {
682 *output = wasm_f32x4_extract_lane(vacc0123, 0);
683 output += 1;
684 }
685 }
686
687 output = (float*) ((uintptr_t) output + output_increment);
688 } while (--output_width != 0);
689 }
690