• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Auto-generated file. Do not edit!
2 //   Template: src/f32-gemm/neon-shuffle.c.in
3 //   Generator: tools/xngen
4 //
5 // Copyright 2019 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 
11 #include <assert.h>
12 
13 #include <arm_neon.h>
14 
15 #include <xnnpack/gemm.h>
16 
17 
xnn_f32_gemm_minmax_ukernel_6x8s4__neon(size_t mr,size_t nc,size_t kc,const float * restrict a,size_t a_stride,const float * restrict w,float * restrict c,size_t cm_stride,size_t cn_stride,const union xnn_f32_minmax_params params[restrict XNN_MIN_ELEMENTS (1)])18 void xnn_f32_gemm_minmax_ukernel_6x8s4__neon(
19     size_t mr,
20     size_t nc,
21     size_t kc,
22     const float* restrict a,
23     size_t a_stride,
24     const float* restrict w,
25     float* restrict c,
26     size_t cm_stride,
27     size_t cn_stride,
28     const union xnn_f32_minmax_params params[restrict XNN_MIN_ELEMENTS(1)])
29 {
30   assert(mr != 0);
31   assert(mr <= 6);
32   assert(nc != 0);
33   assert(kc != 0);
34   assert(kc % sizeof(float) == 0);
35   assert(a != NULL);
36   assert(w != NULL);
37   assert(c != NULL);
38 
39   const float* a0 = a;
40   float* c0 = c;
41   const float* a1 = (const float*) ((uintptr_t) a0 + a_stride);
42   float* c1 = (float*) ((uintptr_t) c0 + cm_stride);
43   if XNN_UNPREDICTABLE(mr < 2) {
44     a1 = a0;
45     c1 = c0;
46   }
47   const float* a2 = (const float*) ((uintptr_t) a1 + a_stride);
48   float* c2 = (float*) ((uintptr_t) c1 + cm_stride);
49   if XNN_UNPREDICTABLE(mr <= 2) {
50     a2 = a1;
51     c2 = c1;
52   }
53   const float* a3 = (const float*) ((uintptr_t) a2 + a_stride);
54   float* c3 = (float*) ((uintptr_t) c2 + cm_stride);
55   if XNN_UNPREDICTABLE(mr < 4) {
56     a3 = a2;
57     c3 = c2;
58   }
59   const float* a4 = (const float*) ((uintptr_t) a3 + a_stride);
60   float* c4 = (float*) ((uintptr_t) c3 + cm_stride);
61   if XNN_UNPREDICTABLE(mr <= 4) {
62     a4 = a3;
63     c4 = c3;
64   }
65   const float* a5 = (const float*) ((uintptr_t) a4 + a_stride);
66   float* c5 = (float*) ((uintptr_t) c4 + cm_stride);
67   if XNN_UNPREDICTABLE(mr != 6) {
68     a5 = a4;
69     c5 = c4;
70   }
71 
72   do {
73     float32x4_t vacc0x0123 = vld1q_f32(w); w += 4;
74     float32x4_t vacc0x4567 = vld1q_f32(w); w += 4;
75     float32x4_t vacc1x0123 = vacc0x0123;
76     float32x4_t vacc1x4567 = vacc0x4567;
77     float32x4_t vacc2x0123 = vacc0x0123;
78     float32x4_t vacc2x4567 = vacc0x4567;
79     float32x4_t vacc3x0123 = vacc0x0123;
80     float32x4_t vacc3x4567 = vacc0x4567;
81     float32x4_t vacc4x0123 = vacc0x0123;
82     float32x4_t vacc4x4567 = vacc0x4567;
83     float32x4_t vacc5x0123 = vacc0x0123;
84     float32x4_t vacc5x4567 = vacc0x4567;
85 
86     size_t k = kc;
87     while (k >= 4 * sizeof(float)) {
88       float32x4_t va0 = vld1q_f32(a0); a0 += 4;
89       float32x4_t va1 = vld1q_f32(a1); a1 += 4;
90       float32x4_t va2 = vld1q_f32(a2); a2 += 4;
91       float32x4_t va3 = vld1q_f32(a3); a3 += 4;
92       float32x4_t va4 = vld1q_f32(a4); a4 += 4;
93       float32x4_t va5 = vld1q_f32(a5); a5 += 4;
94 
95 
96       const float32x4_t vb0123c0 = vld1q_f32(w); w += 4;
97       const float32x4_t vb4567c0 = vld1q_f32(w); w += 4;
98 
99       vacc0x0123 = vmlaq_f32(vacc0x0123, va0, vb0123c0);
100       vacc1x0123 = vmlaq_f32(vacc1x0123, va1, vb0123c0);
101       vacc2x0123 = vmlaq_f32(vacc2x0123, va2, vb0123c0);
102       vacc3x0123 = vmlaq_f32(vacc3x0123, va3, vb0123c0);
103       vacc4x0123 = vmlaq_f32(vacc4x0123, va4, vb0123c0);
104       vacc5x0123 = vmlaq_f32(vacc5x0123, va5, vb0123c0);
105       vacc0x4567 = vmlaq_f32(vacc0x4567, va0, vb4567c0);
106       vacc1x4567 = vmlaq_f32(vacc1x4567, va1, vb4567c0);
107       vacc2x4567 = vmlaq_f32(vacc2x4567, va2, vb4567c0);
108       vacc3x4567 = vmlaq_f32(vacc3x4567, va3, vb4567c0);
109       vacc4x4567 = vmlaq_f32(vacc4x4567, va4, vb4567c0);
110       vacc5x4567 = vmlaq_f32(vacc5x4567, va5, vb4567c0);
111 
112       va0 = vextq_f32(va0, va0, 1);
113       va1 = vextq_f32(va1, va1, 1);
114       va2 = vextq_f32(va2, va2, 1);
115       va3 = vextq_f32(va3, va3, 1);
116       va4 = vextq_f32(va4, va4, 1);
117       va5 = vextq_f32(va5, va5, 1);
118 
119       const float32x4_t vb0123c1 = vld1q_f32(w); w += 4;
120       const float32x4_t vb4567c1 = vld1q_f32(w); w += 4;
121 
122       vacc0x0123 = vmlaq_f32(vacc0x0123, va0, vb0123c1);
123       vacc1x0123 = vmlaq_f32(vacc1x0123, va1, vb0123c1);
124       vacc2x0123 = vmlaq_f32(vacc2x0123, va2, vb0123c1);
125       vacc3x0123 = vmlaq_f32(vacc3x0123, va3, vb0123c1);
126       vacc4x0123 = vmlaq_f32(vacc4x0123, va4, vb0123c1);
127       vacc5x0123 = vmlaq_f32(vacc5x0123, va5, vb0123c1);
128       vacc0x4567 = vmlaq_f32(vacc0x4567, va0, vb4567c1);
129       vacc1x4567 = vmlaq_f32(vacc1x4567, va1, vb4567c1);
130       vacc2x4567 = vmlaq_f32(vacc2x4567, va2, vb4567c1);
131       vacc3x4567 = vmlaq_f32(vacc3x4567, va3, vb4567c1);
132       vacc4x4567 = vmlaq_f32(vacc4x4567, va4, vb4567c1);
133       vacc5x4567 = vmlaq_f32(vacc5x4567, va5, vb4567c1);
134 
135       va0 = vextq_f32(va0, va0, 1);
136       va1 = vextq_f32(va1, va1, 1);
137       va2 = vextq_f32(va2, va2, 1);
138       va3 = vextq_f32(va3, va3, 1);
139       va4 = vextq_f32(va4, va4, 1);
140       va5 = vextq_f32(va5, va5, 1);
141 
142       const float32x4_t vb0123c2 = vld1q_f32(w); w += 4;
143       const float32x4_t vb4567c2 = vld1q_f32(w); w += 4;
144 
145       vacc0x0123 = vmlaq_f32(vacc0x0123, va0, vb0123c2);
146       vacc1x0123 = vmlaq_f32(vacc1x0123, va1, vb0123c2);
147       vacc2x0123 = vmlaq_f32(vacc2x0123, va2, vb0123c2);
148       vacc3x0123 = vmlaq_f32(vacc3x0123, va3, vb0123c2);
149       vacc4x0123 = vmlaq_f32(vacc4x0123, va4, vb0123c2);
150       vacc5x0123 = vmlaq_f32(vacc5x0123, va5, vb0123c2);
151       vacc0x4567 = vmlaq_f32(vacc0x4567, va0, vb4567c2);
152       vacc1x4567 = vmlaq_f32(vacc1x4567, va1, vb4567c2);
153       vacc2x4567 = vmlaq_f32(vacc2x4567, va2, vb4567c2);
154       vacc3x4567 = vmlaq_f32(vacc3x4567, va3, vb4567c2);
155       vacc4x4567 = vmlaq_f32(vacc4x4567, va4, vb4567c2);
156       vacc5x4567 = vmlaq_f32(vacc5x4567, va5, vb4567c2);
157 
158       va0 = vextq_f32(va0, va0, 1);
159       va1 = vextq_f32(va1, va1, 1);
160       va2 = vextq_f32(va2, va2, 1);
161       va3 = vextq_f32(va3, va3, 1);
162       va4 = vextq_f32(va4, va4, 1);
163       va5 = vextq_f32(va5, va5, 1);
164 
165       const float32x4_t vb0123c3 = vld1q_f32(w); w += 4;
166       const float32x4_t vb4567c3 = vld1q_f32(w); w += 4;
167 
168       vacc0x0123 = vmlaq_f32(vacc0x0123, va0, vb0123c3);
169       vacc1x0123 = vmlaq_f32(vacc1x0123, va1, vb0123c3);
170       vacc2x0123 = vmlaq_f32(vacc2x0123, va2, vb0123c3);
171       vacc3x0123 = vmlaq_f32(vacc3x0123, va3, vb0123c3);
172       vacc4x0123 = vmlaq_f32(vacc4x0123, va4, vb0123c3);
173       vacc5x0123 = vmlaq_f32(vacc5x0123, va5, vb0123c3);
174       vacc0x4567 = vmlaq_f32(vacc0x4567, va0, vb4567c3);
175       vacc1x4567 = vmlaq_f32(vacc1x4567, va1, vb4567c3);
176       vacc2x4567 = vmlaq_f32(vacc2x4567, va2, vb4567c3);
177       vacc3x4567 = vmlaq_f32(vacc3x4567, va3, vb4567c3);
178       vacc4x4567 = vmlaq_f32(vacc4x4567, va4, vb4567c3);
179       vacc5x4567 = vmlaq_f32(vacc5x4567, va5, vb4567c3);
180 
181 
182       k -= 4 * sizeof(float);
183     }
184     if XNN_UNLIKELY(k != 0) {
185       float32x4_t va0 = vld1q_f32(a0); a0 = (const float*) ((uintptr_t) a0 + k);
186       float32x4_t va1 = vld1q_f32(a1); a1 = (const float*) ((uintptr_t) a1 + k);
187       float32x4_t va2 = vld1q_f32(a2); a2 = (const float*) ((uintptr_t) a2 + k);
188       float32x4_t va3 = vld1q_f32(a3); a3 = (const float*) ((uintptr_t) a3 + k);
189       float32x4_t va4 = vld1q_f32(a4); a4 = (const float*) ((uintptr_t) a4 + k);
190       float32x4_t va5 = vld1q_f32(a5); a5 = (const float*) ((uintptr_t) a5 + k);
191 
192 
193       const float32x4_t vb0123c0 = vld1q_f32(w); w += 4;
194       const float32x4_t vb4567c0 = vld1q_f32(w); w += 4;
195 
196       const float32x4_t vmska0x0123c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb0123c0, vmovq_n_f32(0.0f))));
197       vacc0x0123 = vmlaq_f32(vacc0x0123, vmska0x0123c0, vb0123c0);
198       const float32x4_t vmska1x0123c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb0123c0, vmovq_n_f32(0.0f))));
199       vacc1x0123 = vmlaq_f32(vacc1x0123, vmska1x0123c0, vb0123c0);
200       const float32x4_t vmska2x0123c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb0123c0, vmovq_n_f32(0.0f))));
201       vacc2x0123 = vmlaq_f32(vacc2x0123, vmska2x0123c0, vb0123c0);
202       const float32x4_t vmska3x0123c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb0123c0, vmovq_n_f32(0.0f))));
203       vacc3x0123 = vmlaq_f32(vacc3x0123, vmska3x0123c0, vb0123c0);
204       const float32x4_t vmska4x0123c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb0123c0, vmovq_n_f32(0.0f))));
205       vacc4x0123 = vmlaq_f32(vacc4x0123, vmska4x0123c0, vb0123c0);
206       const float32x4_t vmska5x0123c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb0123c0, vmovq_n_f32(0.0f))));
207       vacc5x0123 = vmlaq_f32(vacc5x0123, vmska5x0123c0, vb0123c0);
208       const float32x4_t vmska0x4567c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb4567c0, vmovq_n_f32(0.0f))));
209       vacc0x4567 = vmlaq_f32(vacc0x4567, vmska0x4567c0, vb4567c0);
210       const float32x4_t vmska1x4567c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb4567c0, vmovq_n_f32(0.0f))));
211       vacc1x4567 = vmlaq_f32(vacc1x4567, vmska1x4567c0, vb4567c0);
212       const float32x4_t vmska2x4567c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb4567c0, vmovq_n_f32(0.0f))));
213       vacc2x4567 = vmlaq_f32(vacc2x4567, vmska2x4567c0, vb4567c0);
214       const float32x4_t vmska3x4567c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb4567c0, vmovq_n_f32(0.0f))));
215       vacc3x4567 = vmlaq_f32(vacc3x4567, vmska3x4567c0, vb4567c0);
216       const float32x4_t vmska4x4567c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb4567c0, vmovq_n_f32(0.0f))));
217       vacc4x4567 = vmlaq_f32(vacc4x4567, vmska4x4567c0, vb4567c0);
218       const float32x4_t vmska5x4567c0 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb4567c0, vmovq_n_f32(0.0f))));
219       vacc5x4567 = vmlaq_f32(vacc5x4567, vmska5x4567c0, vb4567c0);
220 
221       va0 = vextq_f32(va0, va0, 1);
222       va1 = vextq_f32(va1, va1, 1);
223       va2 = vextq_f32(va2, va2, 1);
224       va3 = vextq_f32(va3, va3, 1);
225       va4 = vextq_f32(va4, va4, 1);
226       va5 = vextq_f32(va5, va5, 1);
227 
228       const float32x4_t vb0123c1 = vld1q_f32(w); w += 4;
229       const float32x4_t vb4567c1 = vld1q_f32(w); w += 4;
230 
231       const float32x4_t vmska0x0123c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb0123c1, vmovq_n_f32(0.0f))));
232       vacc0x0123 = vmlaq_f32(vacc0x0123, vmska0x0123c1, vb0123c1);
233       const float32x4_t vmska1x0123c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb0123c1, vmovq_n_f32(0.0f))));
234       vacc1x0123 = vmlaq_f32(vacc1x0123, vmska1x0123c1, vb0123c1);
235       const float32x4_t vmska2x0123c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb0123c1, vmovq_n_f32(0.0f))));
236       vacc2x0123 = vmlaq_f32(vacc2x0123, vmska2x0123c1, vb0123c1);
237       const float32x4_t vmska3x0123c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb0123c1, vmovq_n_f32(0.0f))));
238       vacc3x0123 = vmlaq_f32(vacc3x0123, vmska3x0123c1, vb0123c1);
239       const float32x4_t vmska4x0123c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb0123c1, vmovq_n_f32(0.0f))));
240       vacc4x0123 = vmlaq_f32(vacc4x0123, vmska4x0123c1, vb0123c1);
241       const float32x4_t vmska5x0123c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb0123c1, vmovq_n_f32(0.0f))));
242       vacc5x0123 = vmlaq_f32(vacc5x0123, vmska5x0123c1, vb0123c1);
243       const float32x4_t vmska0x4567c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb4567c1, vmovq_n_f32(0.0f))));
244       vacc0x4567 = vmlaq_f32(vacc0x4567, vmska0x4567c1, vb4567c1);
245       const float32x4_t vmska1x4567c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb4567c1, vmovq_n_f32(0.0f))));
246       vacc1x4567 = vmlaq_f32(vacc1x4567, vmska1x4567c1, vb4567c1);
247       const float32x4_t vmska2x4567c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb4567c1, vmovq_n_f32(0.0f))));
248       vacc2x4567 = vmlaq_f32(vacc2x4567, vmska2x4567c1, vb4567c1);
249       const float32x4_t vmska3x4567c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb4567c1, vmovq_n_f32(0.0f))));
250       vacc3x4567 = vmlaq_f32(vacc3x4567, vmska3x4567c1, vb4567c1);
251       const float32x4_t vmska4x4567c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb4567c1, vmovq_n_f32(0.0f))));
252       vacc4x4567 = vmlaq_f32(vacc4x4567, vmska4x4567c1, vb4567c1);
253       const float32x4_t vmska5x4567c1 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb4567c1, vmovq_n_f32(0.0f))));
254       vacc5x4567 = vmlaq_f32(vacc5x4567, vmska5x4567c1, vb4567c1);
255 
256       va0 = vextq_f32(va0, va0, 1);
257       va1 = vextq_f32(va1, va1, 1);
258       va2 = vextq_f32(va2, va2, 1);
259       va3 = vextq_f32(va3, va3, 1);
260       va4 = vextq_f32(va4, va4, 1);
261       va5 = vextq_f32(va5, va5, 1);
262 
263       const float32x4_t vb0123c2 = vld1q_f32(w); w += 4;
264       const float32x4_t vb4567c2 = vld1q_f32(w); w += 4;
265 
266       const float32x4_t vmska0x0123c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb0123c2, vmovq_n_f32(0.0f))));
267       vacc0x0123 = vmlaq_f32(vacc0x0123, vmska0x0123c2, vb0123c2);
268       const float32x4_t vmska1x0123c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb0123c2, vmovq_n_f32(0.0f))));
269       vacc1x0123 = vmlaq_f32(vacc1x0123, vmska1x0123c2, vb0123c2);
270       const float32x4_t vmska2x0123c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb0123c2, vmovq_n_f32(0.0f))));
271       vacc2x0123 = vmlaq_f32(vacc2x0123, vmska2x0123c2, vb0123c2);
272       const float32x4_t vmska3x0123c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb0123c2, vmovq_n_f32(0.0f))));
273       vacc3x0123 = vmlaq_f32(vacc3x0123, vmska3x0123c2, vb0123c2);
274       const float32x4_t vmska4x0123c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb0123c2, vmovq_n_f32(0.0f))));
275       vacc4x0123 = vmlaq_f32(vacc4x0123, vmska4x0123c2, vb0123c2);
276       const float32x4_t vmska5x0123c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb0123c2, vmovq_n_f32(0.0f))));
277       vacc5x0123 = vmlaq_f32(vacc5x0123, vmska5x0123c2, vb0123c2);
278       const float32x4_t vmska0x4567c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb4567c2, vmovq_n_f32(0.0f))));
279       vacc0x4567 = vmlaq_f32(vacc0x4567, vmska0x4567c2, vb4567c2);
280       const float32x4_t vmska1x4567c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb4567c2, vmovq_n_f32(0.0f))));
281       vacc1x4567 = vmlaq_f32(vacc1x4567, vmska1x4567c2, vb4567c2);
282       const float32x4_t vmska2x4567c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb4567c2, vmovq_n_f32(0.0f))));
283       vacc2x4567 = vmlaq_f32(vacc2x4567, vmska2x4567c2, vb4567c2);
284       const float32x4_t vmska3x4567c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb4567c2, vmovq_n_f32(0.0f))));
285       vacc3x4567 = vmlaq_f32(vacc3x4567, vmska3x4567c2, vb4567c2);
286       const float32x4_t vmska4x4567c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb4567c2, vmovq_n_f32(0.0f))));
287       vacc4x4567 = vmlaq_f32(vacc4x4567, vmska4x4567c2, vb4567c2);
288       const float32x4_t vmska5x4567c2 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb4567c2, vmovq_n_f32(0.0f))));
289       vacc5x4567 = vmlaq_f32(vacc5x4567, vmska5x4567c2, vb4567c2);
290 
291       va0 = vextq_f32(va0, va0, 1);
292       va1 = vextq_f32(va1, va1, 1);
293       va2 = vextq_f32(va2, va2, 1);
294       va3 = vextq_f32(va3, va3, 1);
295       va4 = vextq_f32(va4, va4, 1);
296       va5 = vextq_f32(va5, va5, 1);
297 
298       const float32x4_t vb0123c3 = vld1q_f32(w); w += 4;
299       const float32x4_t vb4567c3 = vld1q_f32(w); w += 4;
300 
301       const float32x4_t vmska0x0123c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb0123c3, vmovq_n_f32(0.0f))));
302       vacc0x0123 = vmlaq_f32(vacc0x0123, vmska0x0123c3, vb0123c3);
303       const float32x4_t vmska1x0123c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb0123c3, vmovq_n_f32(0.0f))));
304       vacc1x0123 = vmlaq_f32(vacc1x0123, vmska1x0123c3, vb0123c3);
305       const float32x4_t vmska2x0123c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb0123c3, vmovq_n_f32(0.0f))));
306       vacc2x0123 = vmlaq_f32(vacc2x0123, vmska2x0123c3, vb0123c3);
307       const float32x4_t vmska3x0123c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb0123c3, vmovq_n_f32(0.0f))));
308       vacc3x0123 = vmlaq_f32(vacc3x0123, vmska3x0123c3, vb0123c3);
309       const float32x4_t vmska4x0123c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb0123c3, vmovq_n_f32(0.0f))));
310       vacc4x0123 = vmlaq_f32(vacc4x0123, vmska4x0123c3, vb0123c3);
311       const float32x4_t vmska5x0123c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb0123c3, vmovq_n_f32(0.0f))));
312       vacc5x0123 = vmlaq_f32(vacc5x0123, vmska5x0123c3, vb0123c3);
313       const float32x4_t vmska0x4567c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va0), vceqq_f32(vb4567c3, vmovq_n_f32(0.0f))));
314       vacc0x4567 = vmlaq_f32(vacc0x4567, vmska0x4567c3, vb4567c3);
315       const float32x4_t vmska1x4567c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va1), vceqq_f32(vb4567c3, vmovq_n_f32(0.0f))));
316       vacc1x4567 = vmlaq_f32(vacc1x4567, vmska1x4567c3, vb4567c3);
317       const float32x4_t vmska2x4567c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va2), vceqq_f32(vb4567c3, vmovq_n_f32(0.0f))));
318       vacc2x4567 = vmlaq_f32(vacc2x4567, vmska2x4567c3, vb4567c3);
319       const float32x4_t vmska3x4567c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va3), vceqq_f32(vb4567c3, vmovq_n_f32(0.0f))));
320       vacc3x4567 = vmlaq_f32(vacc3x4567, vmska3x4567c3, vb4567c3);
321       const float32x4_t vmska4x4567c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va4), vceqq_f32(vb4567c3, vmovq_n_f32(0.0f))));
322       vacc4x4567 = vmlaq_f32(vacc4x4567, vmska4x4567c3, vb4567c3);
323       const float32x4_t vmska5x4567c3 = vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(va5), vceqq_f32(vb4567c3, vmovq_n_f32(0.0f))));
324       vacc5x4567 = vmlaq_f32(vacc5x4567, vmska5x4567c3, vb4567c3);
325 
326     }
327     const float32x4_t vmax = vld1q_dup_f32(&params->scalar.max);
328     vacc0x0123 = vminq_f32(vacc0x0123, vmax);
329     vacc1x0123 = vminq_f32(vacc1x0123, vmax);
330     vacc2x0123 = vminq_f32(vacc2x0123, vmax);
331     vacc3x0123 = vminq_f32(vacc3x0123, vmax);
332     vacc4x0123 = vminq_f32(vacc4x0123, vmax);
333     vacc5x0123 = vminq_f32(vacc5x0123, vmax);
334     vacc0x4567 = vminq_f32(vacc0x4567, vmax);
335     vacc1x4567 = vminq_f32(vacc1x4567, vmax);
336     vacc2x4567 = vminq_f32(vacc2x4567, vmax);
337     vacc3x4567 = vminq_f32(vacc3x4567, vmax);
338     vacc4x4567 = vminq_f32(vacc4x4567, vmax);
339     vacc5x4567 = vminq_f32(vacc5x4567, vmax);
340 
341     const float32x4_t vmin = vld1q_dup_f32(&params->scalar.min);
342     vacc0x0123 = vmaxq_f32(vacc0x0123, vmin);
343     vacc1x0123 = vmaxq_f32(vacc1x0123, vmin);
344     vacc2x0123 = vmaxq_f32(vacc2x0123, vmin);
345     vacc3x0123 = vmaxq_f32(vacc3x0123, vmin);
346     vacc4x0123 = vmaxq_f32(vacc4x0123, vmin);
347     vacc5x0123 = vmaxq_f32(vacc5x0123, vmin);
348     vacc0x4567 = vmaxq_f32(vacc0x4567, vmin);
349     vacc1x4567 = vmaxq_f32(vacc1x4567, vmin);
350     vacc2x4567 = vmaxq_f32(vacc2x4567, vmin);
351     vacc3x4567 = vmaxq_f32(vacc3x4567, vmin);
352     vacc4x4567 = vmaxq_f32(vacc4x4567, vmin);
353     vacc5x4567 = vmaxq_f32(vacc5x4567, vmin);
354 
355     if XNN_LIKELY(nc >= 8) {
356       vst1q_f32(c5, vacc5x0123);
357       vst1q_f32(c5 + 4, vacc5x4567);
358       c5 = (float*) ((uintptr_t) c5 + cn_stride);
359       vst1q_f32(c4, vacc4x0123);
360       vst1q_f32(c4 + 4, vacc4x4567);
361       c4 = (float*) ((uintptr_t) c4 + cn_stride);
362       vst1q_f32(c3, vacc3x0123);
363       vst1q_f32(c3 + 4, vacc3x4567);
364       c3 = (float*) ((uintptr_t) c3 + cn_stride);
365       vst1q_f32(c2, vacc2x0123);
366       vst1q_f32(c2 + 4, vacc2x4567);
367       c2 = (float*) ((uintptr_t) c2 + cn_stride);
368       vst1q_f32(c1, vacc1x0123);
369       vst1q_f32(c1 + 4, vacc1x4567);
370       c1 = (float*) ((uintptr_t) c1 + cn_stride);
371       vst1q_f32(c0, vacc0x0123);
372       vst1q_f32(c0 + 4, vacc0x4567);
373       c0 = (float*) ((uintptr_t) c0 + cn_stride);
374 
375       a5 = (const float*) ((uintptr_t) a5 - kc);
376       a4 = (const float*) ((uintptr_t) a4 - kc);
377       a3 = (const float*) ((uintptr_t) a3 - kc);
378       a2 = (const float*) ((uintptr_t) a2 - kc);
379       a1 = (const float*) ((uintptr_t) a1 - kc);
380       a0 = (const float*) ((uintptr_t) a0 - kc);
381 
382       nc -= 8;
383 
384     } else {
385       if (nc & 4) {
386         vst1q_f32(c5, vacc5x0123); c5 += 4;
387         vst1q_f32(c4, vacc4x0123); c4 += 4;
388         vst1q_f32(c3, vacc3x0123); c3 += 4;
389         vst1q_f32(c2, vacc2x0123); c2 += 4;
390         vst1q_f32(c1, vacc1x0123); c1 += 4;
391         vst1q_f32(c0, vacc0x0123); c0 += 4;
392 
393         vacc5x0123 = vacc5x4567;
394         vacc4x0123 = vacc4x4567;
395         vacc3x0123 = vacc3x4567;
396         vacc2x0123 = vacc2x4567;
397         vacc1x0123 = vacc1x4567;
398         vacc0x0123 = vacc0x4567;
399       }
400       float32x2_t vacc5x01 = vget_low_f32(vacc5x0123);
401       float32x2_t vacc4x01 = vget_low_f32(vacc4x0123);
402       float32x2_t vacc3x01 = vget_low_f32(vacc3x0123);
403       float32x2_t vacc2x01 = vget_low_f32(vacc2x0123);
404       float32x2_t vacc1x01 = vget_low_f32(vacc1x0123);
405       float32x2_t vacc0x01 = vget_low_f32(vacc0x0123);
406       if (nc & 2) {
407         vst1_f32(c5, vacc5x01); c5 += 2;
408         vst1_f32(c4, vacc4x01); c4 += 2;
409         vst1_f32(c3, vacc3x01); c3 += 2;
410         vst1_f32(c2, vacc2x01); c2 += 2;
411         vst1_f32(c1, vacc1x01); c1 += 2;
412         vst1_f32(c0, vacc0x01); c0 += 2;
413 
414         vacc5x01 = vget_high_f32(vacc5x0123);
415         vacc4x01 = vget_high_f32(vacc4x0123);
416         vacc3x01 = vget_high_f32(vacc3x0123);
417         vacc2x01 = vget_high_f32(vacc2x0123);
418         vacc1x01 = vget_high_f32(vacc1x0123);
419         vacc0x01 = vget_high_f32(vacc0x0123);
420       }
421       if (nc & 1) {
422         vst1_lane_f32(c5, vacc5x01, 0);
423         vst1_lane_f32(c4, vacc4x01, 0);
424         vst1_lane_f32(c3, vacc3x01, 0);
425         vst1_lane_f32(c2, vacc2x01, 0);
426         vst1_lane_f32(c1, vacc1x01, 0);
427         vst1_lane_f32(c0, vacc0x01, 0);
428       }
429 
430       nc = 0;
431     }
432   } while (nc != 0);
433 }
434