1 // Auto-generated file. Do not edit!
2 //   Template: src/f32-dwconv2d-chw/5x5s2p2-neon.c.in
3 //   Generator: tools/xngen
4 //
5 // Copyright 2020 Google LLC
6 //
7 // This source code is licensed under the BSD-style license found in the
8 // LICENSE file in the root directory of this source tree.
9 
10 #include <assert.h>
11 
12 #include <arm_neon.h>
13 
14 #include <xnnpack/dwconv.h>
15 #include <xnnpack/math.h>
16 
17 
xnn_f32_dwconv2d_chw_ukernel_5x5s2p2__neonfma_3x4(size_t input_height,size_t input_width,const float * input,const float * weights,const float * zero,float * output,uint32_t padding_top,const union xnn_f32_chw_params params[restrict XNN_MIN_ELEMENTS (1)])18 void xnn_f32_dwconv2d_chw_ukernel_5x5s2p2__neonfma_3x4(
19     size_t input_height,
20     size_t input_width,
21     const float* input,
22     const float* weights,
23     const float* zero,
24     float* output,
25     uint32_t padding_top,
26     const union xnn_f32_chw_params params[restrict XNN_MIN_ELEMENTS(1)])
27 {
28   assert(input_height != 0);
29   assert(input_width != 0);
30   assert(input_width % sizeof(float) == 0);
31   assert(padding_top >= 1);
32   assert(padding_top <= 2);
33 
34   const uint32x4_t vmask_even = vld1q_u32(params->neon.mask_even);
35   const uint32x4_t vmask_odd = vld1q_u32(params->neon.mask_odd);
36   const float32x4_t vmax = vld1q_dup_f32(&params->neon.max);
37   const float32x4_t vmin = vld1q_dup_f32(&params->neon.min);
38 
39   const float32x4_t vw0123 = vld1q_f32(weights);
40   const float32x4_t vw4567 = vld1q_f32(weights + 4);
41   const float32x4_t vw89AB = vld1q_f32(weights + 8);
42   const float32x4_t vwCDEF = vld1q_f32(weights + 12);
43   const float32x4_t vwGHIJ = vld1q_f32(weights + 16);
44   const float32x4_t vwKLMN = vld1q_f32(weights + 20);
45   const float32x2_t vwOP   = vld1_f32(weights + 24);
46 
47   const uint32_t padding_top_less_1 = padding_top - 1;
48   const size_t input_decrement = round_up_po2(input_width, 8 * sizeof(float));
49 
50   const float* i0 = zero;
51   const float* i1 = (const float*) ((uintptr_t) input - ((-padding_top_less_1) & input_width));
52   const float* i2 = (const float*) ((uintptr_t) i1 + input_width);
53   if XNN_UNPREDICTABLE(padding_top_less_1 != 0) {
54     i1 = zero;
55   }
56   const float* i3 = (const float*) ((uintptr_t) i2 + input_width);
57   const float* i4 = (const float*) ((uintptr_t) i3 + input_width);
58   const float* i5 = (const float*) ((uintptr_t) i4 + input_width);
59   const float* i6 = (const float*) ((uintptr_t) i5 + input_width);
60   const float* i7 = (const float*) ((uintptr_t) i6 + input_width);
61   const float* i8 = (const float*) ((uintptr_t) i7 + input_width);
62 
63   const size_t output_width = round_down_po2((input_width + (2 /* padding */ - 3 /* kernel size */ + 2 /* subsampling */) * sizeof(float)) / 2, sizeof(float));
64 
65   float* o0 = output;
66   float* o1 = (float*) ((uintptr_t) o0 + output_width);
67   float* o2 = (float*) ((uintptr_t) o1 + output_width);
68 
69   size_t padded_input_height = input_height + (padding_top_less_1 + 1) + 2 /* padding bottom */;
70   size_t output_height = (padded_input_height - 5 /* kernel size */ + 2 /* subsampling */) / 2;
71   do {
72     if XNN_UNPREDICTABLE(padded_input_height < 6) {
73       i3 = zero;
74     }
75     if XNN_UNPREDICTABLE(padded_input_height < 7) {
76       i4 = zero;
77       o1 = o0;
78     }
79     if XNN_UNPREDICTABLE(padded_input_height < 8) {
80       i5 = zero;
81     }
82     if XNN_UNPREDICTABLE(padded_input_height < 9) {
83       i6 = zero;
84       o2 = o1;
85     }
86     if XNN_UNPREDICTABLE(padded_input_height < 10) {
87       i7 = zero;
88     }
89     if XNN_UNPREDICTABLE(padded_input_height < 11) {
90       i8 = zero;
91     }
92 
93     float32x4_t vi0x0246 = vmovq_n_f32(0.0f);
94     float32x4_t vi1x0246 = vmovq_n_f32(0.0f);
95     float32x4_t vi2x0246 = vmovq_n_f32(0.0f);
96     float32x4_t vi3x0246 = vmovq_n_f32(0.0f);
97     float32x4_t vi4x0246 = vmovq_n_f32(0.0f);
98     float32x4_t vi5x0246 = vmovq_n_f32(0.0f);
99     float32x4_t vi6x0246 = vmovq_n_f32(0.0f);
100     float32x4_t vi7x0246 = vmovq_n_f32(0.0f);
101     float32x4_t vi8x0246 = vmovq_n_f32(0.0f);
102 
103     float32x4_t vi0x1357 = vmovq_n_f32(0.0f);
104     float32x4_t vi1x1357 = vmovq_n_f32(0.0f);
105     float32x4_t vi2x1357 = vmovq_n_f32(0.0f);
106     float32x4_t vi3x1357 = vmovq_n_f32(0.0f);
107     float32x4_t vi4x1357 = vmovq_n_f32(0.0f);
108     float32x4_t vi5x1357 = vmovq_n_f32(0.0f);
109     float32x4_t vi6x1357 = vmovq_n_f32(0.0f);
110     float32x4_t vi7x1357 = vmovq_n_f32(0.0f);
111     float32x4_t vi8x1357 = vmovq_n_f32(0.0f);
112 
113     float32x4x2_t vi0x8ACE9BDF = vld2q_f32(i0); i0 += 8;
114     float32x4x2_t vi1x8ACE9BDF = vld2q_f32(i1); i1 += 8;
115     float32x4x2_t vi2x8ACE9BDF = vld2q_f32(i2); i2 += 8;
116     float32x4x2_t vi3x8ACE9BDF = vld2q_f32(i3); i3 += 8;
117     float32x4x2_t vi4x8ACE9BDF = vld2q_f32(i4); i4 += 8;
118     float32x4x2_t vi5x8ACE9BDF = vld2q_f32(i5); i5 += 8;
119     float32x4x2_t vi6x8ACE9BDF = vld2q_f32(i6); i6 += 8;
120     float32x4x2_t vi7x8ACE9BDF = vld2q_f32(i7); i7 += 8;
121     float32x4x2_t vi8x8ACE9BDF = vld2q_f32(i8); i8 += 8;
122 
123     size_t w = input_width;
124     for (; w > 8 * sizeof(float); w -= 8 * sizeof(float)) {
125       float32x4_t vo0p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
126       float32x4_t vo1p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
127       float32x4_t vo2p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
128 
129       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x8ACE9BDF.val[0], vget_high_f32(vw0123), 1);
130       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x8ACE9BDF.val[0], vget_high_f32(vw0123), 1);
131       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x8ACE9BDF.val[0], vget_high_f32(vw0123), 1);
132 
133       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x8ACE9BDF.val[0], vget_low_f32(vw89AB), 0);
134       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x8ACE9BDF.val[0], vget_low_f32(vw89AB), 0);
135       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x8ACE9BDF.val[0], vget_low_f32(vw89AB), 0);
136 
137       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x8ACE9BDF.val[0], vget_low_f32(vwCDEF), 1);
138       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x8ACE9BDF.val[0], vget_low_f32(vwCDEF), 1);
139       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x8ACE9BDF.val[0], vget_low_f32(vwCDEF), 1);
140 
141       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x8ACE9BDF.val[0], vget_high_f32(vwGHIJ), 0);
142       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x8ACE9BDF.val[0], vget_high_f32(vwGHIJ), 0);
143       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x8ACE9BDF.val[0], vget_high_f32(vwGHIJ), 0);
144 
145       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x8ACE9BDF.val[0], vget_high_f32(vwKLMN), 1);
146       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x8ACE9BDF.val[0], vget_high_f32(vwKLMN), 1);
147       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x8ACE9BDF.val[0], vget_high_f32(vwKLMN), 1);
148 
149       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x8ACE9BDF.val[1], vget_low_f32(vw4567), 0);
150       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x8ACE9BDF.val[1], vget_low_f32(vw4567), 0);
151       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x8ACE9BDF.val[1], vget_low_f32(vw4567), 0);
152 
153       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x8ACE9BDF.val[1], vget_low_f32(vw89AB), 1);
154       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x8ACE9BDF.val[1], vget_low_f32(vw89AB), 1);
155       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x8ACE9BDF.val[1], vget_low_f32(vw89AB), 1);
156 
157       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x8ACE9BDF.val[1], vget_high_f32(vwCDEF), 0);
158       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x8ACE9BDF.val[1], vget_high_f32(vwCDEF), 0);
159       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x8ACE9BDF.val[1], vget_high_f32(vwCDEF), 0);
160 
161       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x8ACE9BDF.val[1], vget_high_f32(vwGHIJ), 1);
162       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x8ACE9BDF.val[1], vget_high_f32(vwGHIJ), 1);
163       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x8ACE9BDF.val[1], vget_high_f32(vwGHIJ), 1);
164 
165       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x8ACE9BDF.val[1], vwOP, 0);
166       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x8ACE9BDF.val[1], vwOP, 0);
167       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x8ACE9BDF.val[1], vwOP, 0);
168 
169       const float32x4_t vi0x68AC = vextq_f32(vi0x0246, vi0x8ACE9BDF.val[0], 3);
170       vi0x0246 = vi0x8ACE9BDF.val[0];
171       const float32x4_t vi1x68AC = vextq_f32(vi1x0246, vi1x8ACE9BDF.val[0], 3);
172       vi1x0246 = vi1x8ACE9BDF.val[0];
173       const float32x4_t vi2x68AC = vextq_f32(vi2x0246, vi2x8ACE9BDF.val[0], 3);
174       vi2x0246 = vi2x8ACE9BDF.val[0];
175       const float32x4_t vi3x68AC = vextq_f32(vi3x0246, vi3x8ACE9BDF.val[0], 3);
176       vi3x0246 = vi3x8ACE9BDF.val[0];
177       const float32x4_t vi4x68AC = vextq_f32(vi4x0246, vi4x8ACE9BDF.val[0], 3);
178       vi4x0246 = vi4x8ACE9BDF.val[0];
179       const float32x4_t vi5x68AC = vextq_f32(vi5x0246, vi5x8ACE9BDF.val[0], 3);
180       vi5x0246 = vi5x8ACE9BDF.val[0];
181       const float32x4_t vi6x68AC = vextq_f32(vi6x0246, vi6x8ACE9BDF.val[0], 3);
182       vi6x0246 = vi6x8ACE9BDF.val[0];
183       const float32x4_t vi7x68AC = vextq_f32(vi7x0246, vi7x8ACE9BDF.val[0], 3);
184       vi7x0246 = vi7x8ACE9BDF.val[0];
185       const float32x4_t vi8x68AC = vextq_f32(vi8x0246, vi8x8ACE9BDF.val[0], 3);
186       vi8x0246 = vi8x8ACE9BDF.val[0];
187 
188       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x68AC, vget_low_f32(vw0123), 1);
189       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x68AC, vget_low_f32(vw0123), 1);
190       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x68AC, vget_low_f32(vw0123), 1);
191 
192       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x68AC, vget_high_f32(vw4567), 0);
193       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x68AC, vget_high_f32(vw4567), 0);
194       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x68AC, vget_high_f32(vw4567), 0);
195 
196       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x68AC, vget_high_f32(vw89AB), 1);
197       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x68AC, vget_high_f32(vw89AB), 1);
198       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x68AC, vget_high_f32(vw89AB), 1);
199 
200       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x68AC, vget_low_f32(vwGHIJ), 0);
201       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x68AC, vget_low_f32(vwGHIJ), 0);
202       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x68AC, vget_low_f32(vwGHIJ), 0);
203 
204       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x68AC, vget_low_f32(vwKLMN), 1);
205       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x68AC, vget_low_f32(vwKLMN), 1);
206       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x68AC, vget_low_f32(vwKLMN), 1);
207 
208       const float32x4_t vi0x79BD = vextq_f32(vi0x1357, vi0x8ACE9BDF.val[1], 3);
209       vi0x1357 = vi0x8ACE9BDF.val[1];
210       const float32x4_t vi1x79BD = vextq_f32(vi1x1357, vi1x8ACE9BDF.val[1], 3);
211       vi1x1357 = vi1x8ACE9BDF.val[1];
212       const float32x4_t vi2x79BD = vextq_f32(vi2x1357, vi2x8ACE9BDF.val[1], 3);
213       vi2x1357 = vi2x8ACE9BDF.val[1];
214       const float32x4_t vi3x79BD = vextq_f32(vi3x1357, vi3x8ACE9BDF.val[1], 3);
215       vi3x1357 = vi3x8ACE9BDF.val[1];
216       const float32x4_t vi4x79BD = vextq_f32(vi4x1357, vi4x8ACE9BDF.val[1], 3);
217       vi4x1357 = vi4x8ACE9BDF.val[1];
218       const float32x4_t vi5x79BD = vextq_f32(vi5x1357, vi5x8ACE9BDF.val[1], 3);
219       vi5x1357 = vi5x8ACE9BDF.val[1];
220       const float32x4_t vi6x79BD = vextq_f32(vi6x1357, vi6x8ACE9BDF.val[1], 3);
221       vi6x1357 = vi6x8ACE9BDF.val[1];
222       const float32x4_t vi7x79BD = vextq_f32(vi7x1357, vi7x8ACE9BDF.val[1], 3);
223       vi7x1357 = vi7x8ACE9BDF.val[1];
224       const float32x4_t vi8x79BD = vextq_f32(vi8x1357, vi8x8ACE9BDF.val[1], 3);
225       vi8x1357 = vi8x8ACE9BDF.val[1];
226 
227       const float32x4x2_t vi0xGIKMHJLN = vld2q_f32(i0); i0 += 8;
228       const float32x4x2_t vi1xGIKMHJLN = vld2q_f32(i1); i1 += 8;
229       const float32x4x2_t vi2xGIKMHJLN = vld2q_f32(i2); i2 += 8;
230       const float32x4x2_t vi3xGIKMHJLN = vld2q_f32(i3); i3 += 8;
231       const float32x4x2_t vi4xGIKMHJLN = vld2q_f32(i4); i4 += 8;
232       const float32x4x2_t vi5xGIKMHJLN = vld2q_f32(i5); i5 += 8;
233       const float32x4x2_t vi6xGIKMHJLN = vld2q_f32(i6); i6 += 8;
234       const float32x4x2_t vi7xGIKMHJLN = vld2q_f32(i7); i7 += 8;
235       const float32x4x2_t vi8xGIKMHJLN = vld2q_f32(i8); i8 += 8;
236 
237       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x79BD, vget_high_f32(vw0123), 0);
238       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x79BD, vget_high_f32(vw0123), 0);
239       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x79BD, vget_high_f32(vw0123), 0);
240 
241       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x79BD, vget_high_f32(vw4567), 1);
242       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x79BD, vget_high_f32(vw4567), 1);
243       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x79BD, vget_high_f32(vw4567), 1);
244 
245       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x79BD, vget_low_f32(vwCDEF), 0);
246       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x79BD, vget_low_f32(vwCDEF), 0);
247       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x79BD, vget_low_f32(vwCDEF), 0);
248 
249       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x79BD, vget_low_f32(vwGHIJ), 1);
250       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x79BD, vget_low_f32(vwGHIJ), 1);
251       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x79BD, vget_low_f32(vwGHIJ), 1);
252 
253       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x79BD, vget_high_f32(vwKLMN), 0);
254       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x79BD, vget_high_f32(vwKLMN), 0);
255       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x79BD, vget_high_f32(vwKLMN), 0);
256 
257       const float32x4_t vi0xACEG = vextq_f32(vi0x8ACE9BDF.val[0], vi0xGIKMHJLN.val[0], 1);
258       vi0x8ACE9BDF = vi0xGIKMHJLN;
259       const float32x4_t vi1xACEG = vextq_f32(vi1x8ACE9BDF.val[0], vi1xGIKMHJLN.val[0], 1);
260       vi1x8ACE9BDF = vi1xGIKMHJLN;
261       const float32x4_t vi2xACEG = vextq_f32(vi2x8ACE9BDF.val[0], vi2xGIKMHJLN.val[0], 1);
262       vi2x8ACE9BDF = vi2xGIKMHJLN;
263       const float32x4_t vi3xACEG = vextq_f32(vi3x8ACE9BDF.val[0], vi3xGIKMHJLN.val[0], 1);
264       vi3x8ACE9BDF = vi3xGIKMHJLN;
265       const float32x4_t vi4xACEG = vextq_f32(vi4x8ACE9BDF.val[0], vi4xGIKMHJLN.val[0], 1);
266       vi4x8ACE9BDF = vi4xGIKMHJLN;
267       const float32x4_t vi5xACEG = vextq_f32(vi5x8ACE9BDF.val[0], vi5xGIKMHJLN.val[0], 1);
268       vi5x8ACE9BDF = vi5xGIKMHJLN;
269       const float32x4_t vi6xACEG = vextq_f32(vi6x8ACE9BDF.val[0], vi6xGIKMHJLN.val[0], 1);
270       vi6x8ACE9BDF = vi6xGIKMHJLN;
271       const float32x4_t vi7xACEG = vextq_f32(vi7x8ACE9BDF.val[0], vi7xGIKMHJLN.val[0], 1);
272       vi7x8ACE9BDF = vi7xGIKMHJLN;
273       const float32x4_t vi8xACEG = vextq_f32(vi8x8ACE9BDF.val[0], vi8xGIKMHJLN.val[0], 1);
274       vi8x8ACE9BDF = vi8xGIKMHJLN;
275 
276       vo0p0 = vfmaq_lane_f32(vo0p0, vi0xACEG, vget_low_f32(vw4567), 1);
277       vo1p0 = vfmaq_lane_f32(vo1p0, vi2xACEG, vget_low_f32(vw4567), 1);
278       vo2p0 = vfmaq_lane_f32(vo2p0, vi4xACEG, vget_low_f32(vw4567), 1);
279 
280       vo0p0 = vfmaq_lane_f32(vo0p0, vi1xACEG, vget_high_f32(vw89AB), 0);
281       vo1p0 = vfmaq_lane_f32(vo1p0, vi3xACEG, vget_high_f32(vw89AB), 0);
282       vo2p0 = vfmaq_lane_f32(vo2p0, vi5xACEG, vget_high_f32(vw89AB), 0);
283 
284       vo0p0 = vfmaq_lane_f32(vo0p0, vi2xACEG, vget_high_f32(vwCDEF), 1);
285       vo1p0 = vfmaq_lane_f32(vo1p0, vi4xACEG, vget_high_f32(vwCDEF), 1);
286       vo2p0 = vfmaq_lane_f32(vo2p0, vi6xACEG, vget_high_f32(vwCDEF), 1);
287 
288       vo0p0 = vfmaq_lane_f32(vo0p0, vi3xACEG, vget_low_f32(vwKLMN), 0);
289       vo1p0 = vfmaq_lane_f32(vo1p0, vi5xACEG, vget_low_f32(vwKLMN), 0);
290       vo2p0 = vfmaq_lane_f32(vo2p0, vi7xACEG, vget_low_f32(vwKLMN), 0);
291 
292       vo0p0 = vfmaq_lane_f32(vo0p0, vi4xACEG, vwOP, 1);
293       vo1p0 = vfmaq_lane_f32(vo1p0, vi6xACEG, vwOP, 1);
294       vo2p0 = vfmaq_lane_f32(vo2p0, vi8xACEG, vwOP, 1);
295 
296 
297       float32x4_t vo0 = vmaxq_f32(vo0p0, vmin);
298       float32x4_t vo1 = vmaxq_f32(vo1p0, vmin);
299       float32x4_t vo2 = vmaxq_f32(vo2p0, vmin);
300 
301       vo0 = vminq_f32(vo0, vmax);
302       vo1 = vminq_f32(vo1, vmax);
303       vo2 = vminq_f32(vo2, vmax);
304 
305       vst1q_f32(o2, vo2); o2 += 4;
306       vst1q_f32(o1, vo1); o1 += 4;
307       vst1q_f32(o0, vo0); o0 += 4;
308     }
309     // Last block has 1-8 pixels to process.
310     assert(w <= 8 * sizeof(float));
311     assert(w >= 1 * sizeof(float));
312     {
313       float32x4_t vo0p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
314       float32x4_t vo1p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
315       float32x4_t vo2p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
316 
317       const float32x4_t vi0x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi0x8ACE9BDF.val[0])));
318       const float32x4_t vi1x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi1x8ACE9BDF.val[0])));
319       const float32x4_t vi2x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi2x8ACE9BDF.val[0])));
320       const float32x4_t vi3x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi3x8ACE9BDF.val[0])));
321       const float32x4_t vi4x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi4x8ACE9BDF.val[0])));
322       const float32x4_t vi5x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi5x8ACE9BDF.val[0])));
323       const float32x4_t vi6x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi6x8ACE9BDF.val[0])));
324       const float32x4_t vi7x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi7x8ACE9BDF.val[0])));
325       const float32x4_t vi8x8ACE = vreinterpretq_f32_u32(vandq_u32(vmask_even, vreinterpretq_u32_f32(vi8x8ACE9BDF.val[0])));
326 
327       const float32x4_t vi0x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi0x8ACE9BDF.val[1])));
328       const float32x4_t vi1x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi1x8ACE9BDF.val[1])));
329       const float32x4_t vi2x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi2x8ACE9BDF.val[1])));
330       const float32x4_t vi3x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi3x8ACE9BDF.val[1])));
331       const float32x4_t vi4x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi4x8ACE9BDF.val[1])));
332       const float32x4_t vi5x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi5x8ACE9BDF.val[1])));
333       const float32x4_t vi6x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi6x8ACE9BDF.val[1])));
334       const float32x4_t vi7x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi7x8ACE9BDF.val[1])));
335       const float32x4_t vi8x9BDF = vreinterpretq_f32_u32(vandq_u32(vmask_odd, vreinterpretq_u32_f32(vi8x8ACE9BDF.val[1])));
336 
337       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x8ACE, vget_high_f32(vw0123), 1);
338       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x8ACE, vget_high_f32(vw0123), 1);
339       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x8ACE, vget_high_f32(vw0123), 1);
340 
341       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x8ACE, vget_low_f32(vw89AB), 0);
342       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x8ACE, vget_low_f32(vw89AB), 0);
343       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x8ACE, vget_low_f32(vw89AB), 0);
344 
345       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x8ACE, vget_low_f32(vwCDEF), 1);
346       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x8ACE, vget_low_f32(vwCDEF), 1);
347       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x8ACE, vget_low_f32(vwCDEF), 1);
348 
349       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x8ACE, vget_high_f32(vwGHIJ), 0);
350       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x8ACE, vget_high_f32(vwGHIJ), 0);
351       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x8ACE, vget_high_f32(vwGHIJ), 0);
352 
353       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x8ACE, vget_high_f32(vwKLMN), 1);
354       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x8ACE, vget_high_f32(vwKLMN), 1);
355       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x8ACE, vget_high_f32(vwKLMN), 1);
356 
357       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x9BDF, vget_low_f32(vw4567), 0);
358       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x9BDF, vget_low_f32(vw4567), 0);
359       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x9BDF, vget_low_f32(vw4567), 0);
360 
361       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x9BDF, vget_low_f32(vw89AB), 1);
362       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x9BDF, vget_low_f32(vw89AB), 1);
363       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x9BDF, vget_low_f32(vw89AB), 1);
364 
365       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x9BDF, vget_high_f32(vwCDEF), 0);
366       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x9BDF, vget_high_f32(vwCDEF), 0);
367       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x9BDF, vget_high_f32(vwCDEF), 0);
368 
369       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x9BDF, vget_high_f32(vwGHIJ), 1);
370       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x9BDF, vget_high_f32(vwGHIJ), 1);
371       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x9BDF, vget_high_f32(vwGHIJ), 1);
372 
373       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x9BDF, vwOP, 0);
374       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x9BDF, vwOP, 0);
375       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x9BDF, vwOP, 0);
376 
377       const float32x4_t vi0x68AC = vextq_f32(vi0x0246, vi0x8ACE, 3);
378       const float32x4_t vi1x68AC = vextq_f32(vi1x0246, vi1x8ACE, 3);
379       const float32x4_t vi2x68AC = vextq_f32(vi2x0246, vi2x8ACE, 3);
380       const float32x4_t vi3x68AC = vextq_f32(vi3x0246, vi3x8ACE, 3);
381       const float32x4_t vi4x68AC = vextq_f32(vi4x0246, vi4x8ACE, 3);
382       const float32x4_t vi5x68AC = vextq_f32(vi5x0246, vi5x8ACE, 3);
383       const float32x4_t vi6x68AC = vextq_f32(vi6x0246, vi6x8ACE, 3);
384       const float32x4_t vi7x68AC = vextq_f32(vi7x0246, vi7x8ACE, 3);
385       const float32x4_t vi8x68AC = vextq_f32(vi8x0246, vi8x8ACE, 3);
386 
387       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x68AC, vget_low_f32(vw0123), 1);
388       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x68AC, vget_low_f32(vw0123), 1);
389       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x68AC, vget_low_f32(vw0123), 1);
390 
391       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x68AC, vget_high_f32(vw4567), 0);
392       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x68AC, vget_high_f32(vw4567), 0);
393       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x68AC, vget_high_f32(vw4567), 0);
394 
395       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x68AC, vget_high_f32(vw89AB), 1);
396       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x68AC, vget_high_f32(vw89AB), 1);
397       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x68AC, vget_high_f32(vw89AB), 1);
398 
399       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x68AC, vget_low_f32(vwGHIJ), 0);
400       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x68AC, vget_low_f32(vwGHIJ), 0);
401       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x68AC, vget_low_f32(vwGHIJ), 0);
402 
403       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x68AC, vget_low_f32(vwKLMN), 1);
404       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x68AC, vget_low_f32(vwKLMN), 1);
405       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x68AC, vget_low_f32(vwKLMN), 1);
406 
407       const float32x4_t vi0x79BD = vextq_f32(vi0x1357, vi0x9BDF, 3);
408       const float32x4_t vi1x79BD = vextq_f32(vi1x1357, vi1x9BDF, 3);
409       const float32x4_t vi2x79BD = vextq_f32(vi2x1357, vi2x9BDF, 3);
410       const float32x4_t vi3x79BD = vextq_f32(vi3x1357, vi3x9BDF, 3);
411       const float32x4_t vi4x79BD = vextq_f32(vi4x1357, vi4x9BDF, 3);
412       const float32x4_t vi5x79BD = vextq_f32(vi5x1357, vi5x9BDF, 3);
413       const float32x4_t vi6x79BD = vextq_f32(vi6x1357, vi6x9BDF, 3);
414       const float32x4_t vi7x79BD = vextq_f32(vi7x1357, vi7x9BDF, 3);
415       const float32x4_t vi8x79BD = vextq_f32(vi8x1357, vi8x9BDF, 3);
416 
417       vo0p0 = vfmaq_lane_f32(vo0p0, vi0x79BD, vget_high_f32(vw0123), 0);
418       vo1p0 = vfmaq_lane_f32(vo1p0, vi2x79BD, vget_high_f32(vw0123), 0);
419       vo2p0 = vfmaq_lane_f32(vo2p0, vi4x79BD, vget_high_f32(vw0123), 0);
420 
421       vo0p0 = vfmaq_lane_f32(vo0p0, vi1x79BD, vget_high_f32(vw4567), 1);
422       vo1p0 = vfmaq_lane_f32(vo1p0, vi3x79BD, vget_high_f32(vw4567), 1);
423       vo2p0 = vfmaq_lane_f32(vo2p0, vi5x79BD, vget_high_f32(vw4567), 1);
424 
425       vo0p0 = vfmaq_lane_f32(vo0p0, vi2x79BD, vget_low_f32(vwCDEF), 0);
426       vo1p0 = vfmaq_lane_f32(vo1p0, vi4x79BD, vget_low_f32(vwCDEF), 0);
427       vo2p0 = vfmaq_lane_f32(vo2p0, vi6x79BD, vget_low_f32(vwCDEF), 0);
428 
429       vo0p0 = vfmaq_lane_f32(vo0p0, vi3x79BD, vget_low_f32(vwGHIJ), 1);
430       vo1p0 = vfmaq_lane_f32(vo1p0, vi5x79BD, vget_low_f32(vwGHIJ), 1);
431       vo2p0 = vfmaq_lane_f32(vo2p0, vi7x79BD, vget_low_f32(vwGHIJ), 1);
432 
433       vo0p0 = vfmaq_lane_f32(vo0p0, vi4x79BD, vget_high_f32(vwKLMN), 0);
434       vo1p0 = vfmaq_lane_f32(vo1p0, vi6x79BD, vget_high_f32(vwKLMN), 0);
435       vo2p0 = vfmaq_lane_f32(vo2p0, vi8x79BD, vget_high_f32(vwKLMN), 0);
436 
437       const float32x4_t vzero = vmovq_n_f32(0.0f);
438       const float32x4_t vi0xACEG = vextq_f32(vi0x8ACE, vzero, 1);
439       const float32x4_t vi1xACEG = vextq_f32(vi1x8ACE, vzero, 1);
440       const float32x4_t vi2xACEG = vextq_f32(vi2x8ACE, vzero, 1);
441       const float32x4_t vi3xACEG = vextq_f32(vi3x8ACE, vzero, 1);
442       const float32x4_t vi4xACEG = vextq_f32(vi4x8ACE, vzero, 1);
443       const float32x4_t vi5xACEG = vextq_f32(vi5x8ACE, vzero, 1);
444       const float32x4_t vi6xACEG = vextq_f32(vi6x8ACE, vzero, 1);
445       const float32x4_t vi7xACEG = vextq_f32(vi7x8ACE, vzero, 1);
446       const float32x4_t vi8xACEG = vextq_f32(vi8x8ACE, vzero, 1);
447 
448       vo0p0 = vfmaq_lane_f32(vo0p0, vi0xACEG, vget_low_f32(vw4567), 1);
449       vo1p0 = vfmaq_lane_f32(vo1p0, vi2xACEG, vget_low_f32(vw4567), 1);
450       vo2p0 = vfmaq_lane_f32(vo2p0, vi4xACEG, vget_low_f32(vw4567), 1);
451 
452       vo0p0 = vfmaq_lane_f32(vo0p0, vi1xACEG, vget_high_f32(vw89AB), 0);
453       vo1p0 = vfmaq_lane_f32(vo1p0, vi3xACEG, vget_high_f32(vw89AB), 0);
454       vo2p0 = vfmaq_lane_f32(vo2p0, vi5xACEG, vget_high_f32(vw89AB), 0);
455 
456       vo0p0 = vfmaq_lane_f32(vo0p0, vi2xACEG, vget_high_f32(vwCDEF), 1);
457       vo1p0 = vfmaq_lane_f32(vo1p0, vi4xACEG, vget_high_f32(vwCDEF), 1);
458       vo2p0 = vfmaq_lane_f32(vo2p0, vi6xACEG, vget_high_f32(vwCDEF), 1);
459 
460       vo0p0 = vfmaq_lane_f32(vo0p0, vi3xACEG, vget_low_f32(vwKLMN), 0);
461       vo1p0 = vfmaq_lane_f32(vo1p0, vi5xACEG, vget_low_f32(vwKLMN), 0);
462       vo2p0 = vfmaq_lane_f32(vo2p0, vi7xACEG, vget_low_f32(vwKLMN), 0);
463 
464       vo0p0 = vfmaq_lane_f32(vo0p0, vi4xACEG, vwOP, 1);
465       vo1p0 = vfmaq_lane_f32(vo1p0, vi6xACEG, vwOP, 1);
466       vo2p0 = vfmaq_lane_f32(vo2p0, vi8xACEG, vwOP, 1);
467 
468 
469       float32x4_t vo0 = vmaxq_f32(vo0p0, vmin);
470       float32x4_t vo1 = vmaxq_f32(vo1p0, vmin);
471       float32x4_t vo2 = vmaxq_f32(vo2p0, vmin);
472 
473       vo0 = vminq_f32(vo0, vmax);
474       vo1 = vminq_f32(vo1, vmax);
475       vo2 = vminq_f32(vo2, vmax);
476 
477       size_t w_tmp = (w + 1 * sizeof(float)) / (2 * sizeof(float));
478       if XNN_LIKELY(w_tmp >= 4) {
479         vst1q_f32(o2, vo2); o2 += 4;
480         vst1q_f32(o1, vo1); o1 += 4;
481         vst1q_f32(o0, vo0); o0 += 4;
482       } else {
483         float32x2_t vo0_lo = vget_low_f32(vo0);
484         float32x2_t vo1_lo = vget_low_f32(vo1);
485         float32x2_t vo2_lo = vget_low_f32(vo2);
486         if (w_tmp & 2) {
487           vst1_f32(o2, vo2_lo); o2 += 2;
488           vst1_f32(o1, vo1_lo); o1 += 2;
489           vst1_f32(o0, vo0_lo); o0 += 2;
490 
491           vo0_lo = vget_high_f32(vo0);
492           vo1_lo = vget_high_f32(vo1);
493           vo2_lo = vget_high_f32(vo2);
494         }
495         if (w_tmp & 1) {
496           vst1_lane_f32(o2, vo2_lo, 0); o2 += 1;
497           vst1_lane_f32(o1, vo1_lo, 0); o1 += 1;
498           vst1_lane_f32(o0, vo0_lo, 0); o0 += 1;
499         }
500       }
501     }
502 
503     i0 = (const float*) ((uintptr_t) i6 - input_decrement);
504     i1 = (const float*) ((uintptr_t) i7 - input_decrement);
505     i2 = (const float*) ((uintptr_t) i8 - input_decrement);
506     i3 = (const float*) ((uintptr_t) i2 + input_width);
507     i4 = (const float*) ((uintptr_t) i3 + input_width);
508     i5 = (const float*) ((uintptr_t) i4 + input_width);
509     i6 = (const float*) ((uintptr_t) i5 + input_width);
510     i7 = (const float*) ((uintptr_t) i6 + input_width);
511     i8 = (const float*) ((uintptr_t) i7 + input_width);
512 
513     o0 = o2;
514     o1 = (float*) ((uintptr_t) o0 + output_width);
515     o2 = (float*) ((uintptr_t) o1 + output_width);
516 
517     output_height = doz(output_height, 3);
518     padded_input_height = doz(padded_input_height, 6);
519   } while (output_height != 0);
520 }
521