Debian Codegraph @

src/f32-dwconv2d-chw/gen/f32-dwconv2d-chw-3x3p1-minmax-aarch64-neonfma-6x4.c

raw symbols SCIP
1 // Auto-generated file. Do not edit!
2 // Template: src/f32-dwconv2d-chw/3x3p1-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
18 void xnn_f32_dwconv2d_chw_ukernel_3x3p1__aarch64_neonfma_6x4(
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_minmax_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
27 {
28 assert(input_height != 0);
29 assert(input_width != 0);
30 assert(input_width % sizeof(float) == 0);
31 assert(padding_top == 1);
32
33 const float32x4_t vmax = vld1q_dup_f32(&params->scalar.max);
34 const float32x4_t vmin = vld1q_dup_f32(&params->scalar.min);
35
36 static const int32_t mask_table[7] = {-1, -1, -1, -1, 0, 0, 0};
37 const uint32x4_t vmask = vld1q_u32((const uint32_t*) &mask_table[3 - (((input_width >> 2) - 1) & 3)]);
38
39 const float32x4_t vw0123 = vld1q_f32(weights);
40 const float32x4_t vw4567 = vld1q_f32(weights + 4);
41 const float32x2_t vw89 = vld1_f32(weights + 8);
42
43 const size_t input_decrement = round_up_po2(input_width, 4 * sizeof(float));
44
45 const float* i0 = zero;
46 const float* i1 = input;
47 const float* i2 = (const float*) ((uintptr_t) i1 + input_width);
48 const float* i3 = (const float*) ((uintptr_t) i2 + input_width);
49 const float* i4 = (const float*) ((uintptr_t) i3 + input_width);
50 const float* i5 = (const float*) ((uintptr_t) i4 + input_width);
51 const float* i6 = (const float*) ((uintptr_t) i5 + input_width);
52 const float* i7 = (const float*) ((uintptr_t) i6 + input_width);
53
54 float* o0 = output;
55 float* o1 = (float*) ((uintptr_t) o0 + input_width);
56 float* o2 = (float*) ((uintptr_t) o1 + input_width);
57 float* o3 = (float*) ((uintptr_t) o2 + input_width);
58 float* o4 = (float*) ((uintptr_t) o3 + input_width);
59 float* o5 = (float*) ((uintptr_t) o4 + input_width);
60
61 size_t output_height = input_height;
62 do {
63 if XNN_UNPREDICTABLE(output_height < 2) {
64 i2 = zero;
65 o1 = o0;
66 }
67 if XNN_UNPREDICTABLE(output_height < 3) {
68 i3 = zero;
69 o2 = o1;
70 }
71 if XNN_UNPREDICTABLE(output_height < 4) {
72 i4 = zero;
73 o3 = o2;
74 }
75 if XNN_UNPREDICTABLE(output_height < 5) {
76 i5 = zero;
77 o4 = o3;
78 }
79 if XNN_UNPREDICTABLE(output_height < 6) {
80 i6 = zero;
81 o5 = o4;
82 }
83 if XNN_UNPREDICTABLE(output_height < 7) {
84 i7 = zero;
85 }
86
87 float32x4_t vi0x0123 = vmovq_n_f32(0.0f);
88 float32x4_t vi1x0123 = vmovq_n_f32(0.0f);
89 float32x4_t vi2x0123 = vmovq_n_f32(0.0f);
90 float32x4_t vi3x0123 = vmovq_n_f32(0.0f);
91 float32x4_t vi4x0123 = vmovq_n_f32(0.0f);
92 float32x4_t vi5x0123 = vmovq_n_f32(0.0f);
93 float32x4_t vi6x0123 = vmovq_n_f32(0.0f);
94 float32x4_t vi7x0123 = vmovq_n_f32(0.0f);
95
96 float32x4_t vi0x4567 = vld1q_f32(i0); i0 += 4;
97 float32x4_t vi1x4567 = vld1q_f32(i1); i1 += 4;
98 float32x4_t vi2x4567 = vld1q_f32(i2); i2 += 4;
99 float32x4_t vi3x4567 = vld1q_f32(i3); i3 += 4;
100 float32x4_t vi4x4567 = vld1q_f32(i4); i4 += 4;
101 float32x4_t vi5x4567 = vld1q_f32(i5); i5 += 4;
102 float32x4_t vi6x4567 = vld1q_f32(i6); i6 += 4;
103 float32x4_t vi7x4567 = vld1q_f32(i7); i7 += 4;
104
105 size_t w = input_width;
106 for (; w > 4 * sizeof(float); w -= 4 * sizeof(float)) {
107 float32x4_t vo0p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
108 float32x4_t vo1p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
109 float32x4_t vo2p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
110 float32x4_t vo3p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
111 float32x4_t vo4p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
112 float32x4_t vo5p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
113
114 const float32x4_t vi0x89AB = vld1q_f32(i0); i0 += 4;
115 const float32x4_t vi1x89AB = vld1q_f32(i1); i1 += 4;
116 const float32x4_t vi2x89AB = vld1q_f32(i2); i2 += 4;
117 const float32x4_t vi3x89AB = vld1q_f32(i3); i3 += 4;
118 const float32x4_t vi4x89AB = vld1q_f32(i4); i4 += 4;
119 const float32x4_t vi5x89AB = vld1q_f32(i5); i5 += 4;
120 const float32x4_t vi6x89AB = vld1q_f32(i6); i6 += 4;
121 const float32x4_t vi7x89AB = vld1q_f32(i7); i7 += 4;
122
123 vo0p0 = vfmaq_lane_f32(vo0p0, vi0x4567, vget_high_f32(vw0123), 0);
124 vo1p0 = vfmaq_lane_f32(vo1p0, vi1x4567, vget_high_f32(vw0123), 0);
125 vo2p0 = vfmaq_lane_f32(vo2p0, vi2x4567, vget_high_f32(vw0123), 0);
126 vo3p0 = vfmaq_lane_f32(vo3p0, vi3x4567, vget_high_f32(vw0123), 0);
127 vo4p0 = vfmaq_lane_f32(vo4p0, vi4x4567, vget_high_f32(vw0123), 0);
128 vo5p0 = vfmaq_lane_f32(vo5p0, vi5x4567, vget_high_f32(vw0123), 0);
129
130 vo0p0 = vfmaq_lane_f32(vo0p0, vi1x4567, vget_low_f32(vw4567), 1);
131 vo1p0 = vfmaq_lane_f32(vo1p0, vi2x4567, vget_low_f32(vw4567), 1);
132 vo2p0 = vfmaq_lane_f32(vo2p0, vi3x4567, vget_low_f32(vw4567), 1);
133 vo3p0 = vfmaq_lane_f32(vo3p0, vi4x4567, vget_low_f32(vw4567), 1);
134 vo4p0 = vfmaq_lane_f32(vo4p0, vi5x4567, vget_low_f32(vw4567), 1);
135 vo5p0 = vfmaq_lane_f32(vo5p0, vi6x4567, vget_low_f32(vw4567), 1);
136
137 vo0p0 = vfmaq_lane_f32(vo0p0, vi2x4567, vw89, 0);
138 vo1p0 = vfmaq_lane_f32(vo1p0, vi3x4567, vw89, 0);
139 vo2p0 = vfmaq_lane_f32(vo2p0, vi4x4567, vw89, 0);
140 vo3p0 = vfmaq_lane_f32(vo3p0, vi5x4567, vw89, 0);
141 vo4p0 = vfmaq_lane_f32(vo4p0, vi6x4567, vw89, 0);
142 vo5p0 = vfmaq_lane_f32(vo5p0, vi7x4567, vw89, 0);
143
144 const float32x4_t vi0x3456 = vextq_f32(vi0x0123, vi0x4567, 3);
145 const float32x4_t vi1x3456 = vextq_f32(vi1x0123, vi1x4567, 3);
146 const float32x4_t vi2x3456 = vextq_f32(vi2x0123, vi2x4567, 3);
147 const float32x4_t vi3x3456 = vextq_f32(vi3x0123, vi3x4567, 3);
148 const float32x4_t vi4x3456 = vextq_f32(vi4x0123, vi4x4567, 3);
149 const float32x4_t vi5x3456 = vextq_f32(vi5x0123, vi5x4567, 3);
150 const float32x4_t vi6x3456 = vextq_f32(vi6x0123, vi6x4567, 3);
151 const float32x4_t vi7x3456 = vextq_f32(vi7x0123, vi7x4567, 3);
152
153 vo0p0 = vfmaq_lane_f32(vo0p0, vi0x3456, vget_low_f32(vw0123), 1);
154 vo1p0 = vfmaq_lane_f32(vo1p0, vi1x3456, vget_low_f32(vw0123), 1);
155 vo2p0 = vfmaq_lane_f32(vo2p0, vi2x3456, vget_low_f32(vw0123), 1);
156 vo3p0 = vfmaq_lane_f32(vo3p0, vi3x3456, vget_low_f32(vw0123), 1);
157 vo4p0 = vfmaq_lane_f32(vo4p0, vi4x3456, vget_low_f32(vw0123), 1);
158 vo5p0 = vfmaq_lane_f32(vo5p0, vi5x3456, vget_low_f32(vw0123), 1);
159
160 vo0p0 = vfmaq_lane_f32(vo0p0, vi1x3456, vget_low_f32(vw4567), 0);
161 vo1p0 = vfmaq_lane_f32(vo1p0, vi2x3456, vget_low_f32(vw4567), 0);
162 vo2p0 = vfmaq_lane_f32(vo2p0, vi3x3456, vget_low_f32(vw4567), 0);
163 vo3p0 = vfmaq_lane_f32(vo3p0, vi4x3456, vget_low_f32(vw4567), 0);
164 vo4p0 = vfmaq_lane_f32(vo4p0, vi5x3456, vget_low_f32(vw4567), 0);
165 vo5p0 = vfmaq_lane_f32(vo5p0, vi6x3456, vget_low_f32(vw4567), 0);
166
167 vo0p0 = vfmaq_lane_f32(vo0p0, vi2x3456, vget_high_f32(vw4567), 1);
168 vo1p0 = vfmaq_lane_f32(vo1p0, vi3x3456, vget_high_f32(vw4567), 1);
169 vo2p0 = vfmaq_lane_f32(vo2p0, vi4x3456, vget_high_f32(vw4567), 1);
170 vo3p0 = vfmaq_lane_f32(vo3p0, vi5x3456, vget_high_f32(vw4567), 1);
171 vo4p0 = vfmaq_lane_f32(vo4p0, vi6x3456, vget_high_f32(vw4567), 1);
172 vo5p0 = vfmaq_lane_f32(vo5p0, vi7x3456, vget_high_f32(vw4567), 1);
173
174 vi0x0123 = vi0x4567;
175 vi1x0123 = vi1x4567;
176 vi2x0123 = vi2x4567;
177 vi3x0123 = vi3x4567;
178 vi4x0123 = vi4x4567;
179 vi5x0123 = vi5x4567;
180 vi6x0123 = vi6x4567;
181 vi7x0123 = vi7x4567;
182
183 const float32x4_t vi0x5678 = vextq_f32(vi0x4567, vi0x89AB, 1);
184 const float32x4_t vi1x5678 = vextq_f32(vi1x4567, vi1x89AB, 1);
185 const float32x4_t vi2x5678 = vextq_f32(vi2x4567, vi2x89AB, 1);
186 const float32x4_t vi3x5678 = vextq_f32(vi3x4567, vi3x89AB, 1);
187 const float32x4_t vi4x5678 = vextq_f32(vi4x4567, vi4x89AB, 1);
188 const float32x4_t vi5x5678 = vextq_f32(vi5x4567, vi5x89AB, 1);
189 const float32x4_t vi6x5678 = vextq_f32(vi6x4567, vi6x89AB, 1);
190 const float32x4_t vi7x5678 = vextq_f32(vi7x4567, vi7x89AB, 1);
191
192 vo0p0 = vfmaq_lane_f32(vo0p0, vi0x5678, vget_high_f32(vw0123), 1);
193 vo1p0 = vfmaq_lane_f32(vo1p0, vi1x5678, vget_high_f32(vw0123), 1);
194 vo2p0 = vfmaq_lane_f32(vo2p0, vi2x5678, vget_high_f32(vw0123), 1);
195 vo3p0 = vfmaq_lane_f32(vo3p0, vi3x5678, vget_high_f32(vw0123), 1);
196 vo4p0 = vfmaq_lane_f32(vo4p0, vi4x5678, vget_high_f32(vw0123), 1);
197 vo5p0 = vfmaq_lane_f32(vo5p0, vi5x5678, vget_high_f32(vw0123), 1);
198
199 vo0p0 = vfmaq_lane_f32(vo0p0, vi1x5678, vget_high_f32(vw4567), 0);
200 vo1p0 = vfmaq_lane_f32(vo1p0, vi2x5678, vget_high_f32(vw4567), 0);
201 vo2p0 = vfmaq_lane_f32(vo2p0, vi3x5678, vget_high_f32(vw4567), 0);
202 vo3p0 = vfmaq_lane_f32(vo3p0, vi4x5678, vget_high_f32(vw4567), 0);
203 vo4p0 = vfmaq_lane_f32(vo4p0, vi5x5678, vget_high_f32(vw4567), 0);
204 vo5p0 = vfmaq_lane_f32(vo5p0, vi6x5678, vget_high_f32(vw4567), 0);
205
206 vo0p0 = vfmaq_lane_f32(vo0p0, vi2x5678, vw89, 1);
207 vo1p0 = vfmaq_lane_f32(vo1p0, vi3x5678, vw89, 1);
208 vo2p0 = vfmaq_lane_f32(vo2p0, vi4x5678, vw89, 1);
209 vo3p0 = vfmaq_lane_f32(vo3p0, vi5x5678, vw89, 1);
210 vo4p0 = vfmaq_lane_f32(vo4p0, vi6x5678, vw89, 1);
211 vo5p0 = vfmaq_lane_f32(vo5p0, vi7x5678, vw89, 1);
212
213 vi0x4567 = vi0x89AB;
214 vi1x4567 = vi1x89AB;
215 vi2x4567 = vi2x89AB;
216 vi3x4567 = vi3x89AB;
217 vi4x4567 = vi4x89AB;
218 vi5x4567 = vi5x89AB;
219 vi6x4567 = vi6x89AB;
220 vi7x4567 = vi7x89AB;
221
222
223 float32x4_t vo0 = vmaxq_f32(vo0p0, vmin);
224 float32x4_t vo1 = vmaxq_f32(vo1p0, vmin);
225 float32x4_t vo2 = vmaxq_f32(vo2p0, vmin);
226 float32x4_t vo3 = vmaxq_f32(vo3p0, vmin);
227 float32x4_t vo4 = vmaxq_f32(vo4p0, vmin);
228 float32x4_t vo5 = vmaxq_f32(vo5p0, vmin);
229
230 vo0 = vminq_f32(vo0, vmax);
231 vo1 = vminq_f32(vo1, vmax);
232 vo2 = vminq_f32(vo2, vmax);
233 vo3 = vminq_f32(vo3, vmax);
234 vo4 = vminq_f32(vo4, vmax);
235 vo5 = vminq_f32(vo5, vmax);
236
237 vst1q_f32(o5, vo5); o5 += 4;
238 vst1q_f32(o4, vo4); o4 += 4;
239 vst1q_f32(o3, vo3); o3 += 4;
240 vst1q_f32(o2, vo2); o2 += 4;
241 vst1q_f32(o1, vo1); o1 += 4;
242 vst1q_f32(o0, vo0); o0 += 4;
243 }
244 // Always process the last block of 1..4 pixels.
245 assert(w >= 1 * sizeof(float));
246 assert(w <= 4 * sizeof(float));
247 {
248 float32x4_t vo0p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
249 float32x4_t vo1p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
250 float32x4_t vo2p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
251 float32x4_t vo3p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
252 float32x4_t vo4p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
253 float32x4_t vo5p0 = vdupq_lane_f32(vget_low_f32(vw0123), 0);
254
255 vi0x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi0x4567)));
256 vi1x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi1x4567)));
257 vi2x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi2x4567)));
258 vi3x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi3x4567)));
259 vi4x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi4x4567)));
260 vi5x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi5x4567)));
261 vi6x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi6x4567)));
262 vi7x4567 = vreinterpretq_f32_u32(vandq_u32(vmask, vreinterpretq_u32_f32(vi7x4567)));
263
264 vo0p0 = vfmaq_lane_f32(vo0p0, vi0x4567, vget_high_f32(vw0123), 0);
265 vo1p0 = vfmaq_lane_f32(vo1p0, vi1x4567, vget_high_f32(vw0123), 0);
266 vo2p0 = vfmaq_lane_f32(vo2p0, vi2x4567, vget_high_f32(vw0123), 0);
267 vo3p0 = vfmaq_lane_f32(vo3p0, vi3x4567, vget_high_f32(vw0123), 0);
268 vo4p0 = vfmaq_lane_f32(vo4p0, vi4x4567, vget_high_f32(vw0123), 0);
269 vo5p0 = vfmaq_lane_f32(vo5p0, vi5x4567, vget_high_f32(vw0123), 0);
270
271 vo0p0 = vfmaq_lane_f32(vo0p0, vi1x4567, vget_low_f32(vw4567), 1);
272 vo1p0 = vfmaq_lane_f32(vo1p0, vi2x4567, vget_low_f32(vw4567), 1);
273 vo2p0 = vfmaq_lane_f32(vo2p0, vi3x4567, vget_low_f32(vw4567), 1);
274 vo3p0 = vfmaq_lane_f32(vo3p0, vi4x4567, vget_low_f32(vw4567), 1);
275 vo4p0 = vfmaq_lane_f32(vo4p0, vi5x4567, vget_low_f32(vw4567), 1);
276 vo5p0 = vfmaq_lane_f32(vo5p0, vi6x4567, vget_low_f32(vw4567), 1);
277
278 vo0p0 = vfmaq_lane_f32(vo0p0, vi2x4567, vw89, 0);
279 vo1p0 = vfmaq_lane_f32(vo1p0, vi3x4567, vw89, 0);
280 vo2p0 = vfmaq_lane_f32(vo2p0, vi4x4567, vw89, 0);
281 vo3p0 = vfmaq_lane_f32(vo3p0, vi5x4567, vw89, 0);
282 vo4p0 = vfmaq_lane_f32(vo4p0, vi6x4567, vw89, 0);
283 vo5p0 = vfmaq_lane_f32(vo5p0, vi7x4567, vw89, 0);
284
285 const float32x4_t vi0x3456 = vextq_f32(vi0x0123, vi0x4567, 3);
286 const float32x4_t vi1x3456 = vextq_f32(vi1x0123, vi1x4567, 3);
287 const float32x4_t vi2x3456 = vextq_f32(vi2x0123, vi2x4567, 3);
288 const float32x4_t vi3x3456 = vextq_f32(vi3x0123, vi3x4567, 3);
289 const float32x4_t vi4x3456 = vextq_f32(vi4x0123, vi4x4567, 3);
290 const float32x4_t vi5x3456 = vextq_f32(vi5x0123, vi5x4567, 3);
291 const float32x4_t vi6x3456 = vextq_f32(vi6x0123, vi6x4567, 3);
292 const float32x4_t vi7x3456 = vextq_f32(vi7x0123, vi7x4567, 3);
293
294 vo0p0 = vfmaq_lane_f32(vo0p0, vi0x3456, vget_low_f32(vw0123), 1);
295 vo1p0 = vfmaq_lane_f32(vo1p0, vi1x3456, vget_low_f32(vw0123), 1);
296 vo2p0 = vfmaq_lane_f32(vo2p0, vi2x3456, vget_low_f32(vw0123), 1);
297 vo3p0 = vfmaq_lane_f32(vo3p0, vi3x3456, vget_low_f32(vw0123), 1);
298 vo4p0 = vfmaq_lane_f32(vo4p0, vi4x3456, vget_low_f32(vw0123), 1);
299 vo5p0 = vfmaq_lane_f32(vo5p0, vi5x3456, vget_low_f32(vw0123), 1);
300
301 vo0p0 = vfmaq_lane_f32(vo0p0, vi1x3456, vget_low_f32(vw4567), 0);
302 vo1p0 = vfmaq_lane_f32(vo1p0, vi2x3456, vget_low_f32(vw4567), 0);
303 vo2p0 = vfmaq_lane_f32(vo2p0, vi3x3456, vget_low_f32(vw4567), 0);
304 vo3p0 = vfmaq_lane_f32(vo3p0, vi4x3456, vget_low_f32(vw4567), 0);
305 vo4p0 = vfmaq_lane_f32(vo4p0, vi5x3456, vget_low_f32(vw4567), 0);
306 vo5p0 = vfmaq_lane_f32(vo5p0, vi6x3456, vget_low_f32(vw4567), 0);
307
308 vo0p0 = vfmaq_lane_f32(vo0p0, vi2x3456, vget_high_f32(vw4567), 1);
309 vo1p0 = vfmaq_lane_f32(vo1p0, vi3x3456, vget_high_f32(vw4567), 1);
310 vo2p0 = vfmaq_lane_f32(vo2p0, vi4x3456, vget_high_f32(vw4567), 1);
311 vo3p0 = vfmaq_lane_f32(vo3p0, vi5x3456, vget_high_f32(vw4567), 1);
312 vo4p0 = vfmaq_lane_f32(vo4p0, vi6x3456, vget_high_f32(vw4567), 1);
313 vo5p0 = vfmaq_lane_f32(vo5p0, vi7x3456, vget_high_f32(vw4567), 1);
314
315 const float32x4_t vzero = vmovq_n_f32(0.0f);
316 const float32x4_t vi0x5678 = vextq_f32(vi0x4567, vzero, 1);
317 const float32x4_t vi1x5678 = vextq_f32(vi1x4567, vzero, 1);
318 const float32x4_t vi2x5678 = vextq_f32(vi2x4567, vzero, 1);
319 const float32x4_t vi3x5678 = vextq_f32(vi3x4567, vzero, 1);
320 const float32x4_t vi4x5678 = vextq_f32(vi4x4567, vzero, 1);
321 const float32x4_t vi5x5678 = vextq_f32(vi5x4567, vzero, 1);
322 const float32x4_t vi6x5678 = vextq_f32(vi6x4567, vzero, 1);
323 const float32x4_t vi7x5678 = vextq_f32(vi7x4567, vzero, 1);
324
325 vo0p0 = vfmaq_lane_f32(vo0p0, vi0x5678, vget_high_f32(vw0123), 1);
326 vo1p0 = vfmaq_lane_f32(vo1p0, vi1x5678, vget_high_f32(vw0123), 1);
327 vo2p0 = vfmaq_lane_f32(vo2p0, vi2x5678, vget_high_f32(vw0123), 1);
328 vo3p0 = vfmaq_lane_f32(vo3p0, vi3x5678, vget_high_f32(vw0123), 1);
329 vo4p0 = vfmaq_lane_f32(vo4p0, vi4x5678, vget_high_f32(vw0123), 1);
330 vo5p0 = vfmaq_lane_f32(vo5p0, vi5x5678, vget_high_f32(vw0123), 1);
331
332 vo0p0 = vfmaq_lane_f32(vo0p0, vi1x5678, vget_high_f32(vw4567), 0);
333 vo1p0 = vfmaq_lane_f32(vo1p0, vi2x5678, vget_high_f32(vw4567), 0);
334 vo2p0 = vfmaq_lane_f32(vo2p0, vi3x5678, vget_high_f32(vw4567), 0);
335 vo3p0 = vfmaq_lane_f32(vo3p0, vi4x5678, vget_high_f32(vw4567), 0);
336 vo4p0 = vfmaq_lane_f32(vo4p0, vi5x5678, vget_high_f32(vw4567), 0);
337 vo5p0 = vfmaq_lane_f32(vo5p0, vi6x5678, vget_high_f32(vw4567), 0);
338
339 vo0p0 = vfmaq_lane_f32(vo0p0, vi2x5678, vw89, 1);
340 vo1p0 = vfmaq_lane_f32(vo1p0, vi3x5678, vw89, 1);
341 vo2p0 = vfmaq_lane_f32(vo2p0, vi4x5678, vw89, 1);
342 vo3p0 = vfmaq_lane_f32(vo3p0, vi5x5678, vw89, 1);
343 vo4p0 = vfmaq_lane_f32(vo4p0, vi6x5678, vw89, 1);
344 vo5p0 = vfmaq_lane_f32(vo5p0, vi7x5678, vw89, 1);
345
346
347 float32x4_t vo0 = vmaxq_f32(vo0p0, vmin);
348 float32x4_t vo1 = vmaxq_f32(vo1p0, vmin);
349 float32x4_t vo2 = vmaxq_f32(vo2p0, vmin);
350 float32x4_t vo3 = vmaxq_f32(vo3p0, vmin);
351 float32x4_t vo4 = vmaxq_f32(vo4p0, vmin);
352 float32x4_t vo5 = vmaxq_f32(vo5p0, vmin);
353
354 vo0 = vminq_f32(vo0, vmax);
355 vo1 = vminq_f32(vo1, vmax);
356 vo2 = vminq_f32(vo2, vmax);
357 vo3 = vminq_f32(vo3, vmax);
358 vo4 = vminq_f32(vo4, vmax);
359 vo5 = vminq_f32(vo5, vmax);
360
361 if XNN_LIKELY(w == 4 * sizeof(float)) {
362 vst1q_f32(o5, vo5); o5 += 4;
363 vst1q_f32(o4, vo4); o4 += 4;
364 vst1q_f32(o3, vo3); o3 += 4;
365 vst1q_f32(o2, vo2); o2 += 4;
366 vst1q_f32(o1, vo1); o1 += 4;
367 vst1q_f32(o0, vo0); o0 += 4;
368 } else {
369 float32x2_t vo0_lo = vget_low_f32(vo0);
370 float32x2_t vo1_lo = vget_low_f32(vo1);
371 float32x2_t vo2_lo = vget_low_f32(vo2);
372 float32x2_t vo3_lo = vget_low_f32(vo3);
373 float32x2_t vo4_lo = vget_low_f32(vo4);
374 float32x2_t vo5_lo = vget_low_f32(vo5);
375 if (w & (2 * sizeof(float))) {
376 vst1_f32(o5, vo5_lo); o5 += 2;
377 vst1_f32(o4, vo4_lo); o4 += 2;
378 vst1_f32(o3, vo3_lo); o3 += 2;
379 vst1_f32(o2, vo2_lo); o2 += 2;
380 vst1_f32(o1, vo1_lo); o1 += 2;
381 vst1_f32(o0, vo0_lo); o0 += 2;
382
383 vo0_lo = vget_high_f32(vo0);
384 vo1_lo = vget_high_f32(vo1);
385 vo2_lo = vget_high_f32(vo2);
386 vo3_lo = vget_high_f32(vo3);
387 vo4_lo = vget_high_f32(vo4);
388 vo5_lo = vget_high_f32(vo5);
389 }
390 if (w & (1 * sizeof(float))) {
391 vst1_lane_f32(o5, vo5_lo, 0); o5 += 1;
392 vst1_lane_f32(o4, vo4_lo, 0); o4 += 1;
393 vst1_lane_f32(o3, vo3_lo, 0); o3 += 1;
394 vst1_lane_f32(o2, vo2_lo, 0); o2 += 1;
395 vst1_lane_f32(o1, vo1_lo, 0); o1 += 1;
396 vst1_lane_f32(o0, vo0_lo, 0); o0 += 1;
397 }
398 }
399 }
400
401 i0 = (const float*) ((uintptr_t) i6 - input_decrement);
402 i1 = (const float*) ((uintptr_t) i7 - input_decrement);
403 i2 = (const float*) ((uintptr_t) i1 + input_width);
404 i3 = (const float*) ((uintptr_t) i2 + input_width);
405 i4 = (const float*) ((uintptr_t) i3 + input_width);
406 i5 = (const float*) ((uintptr_t) i4 + input_width);
407 i6 = (const float*) ((uintptr_t) i5 + input_width);
408 i7 = (const float*) ((uintptr_t) i6 + input_width);
409
410 o0 = o5;
411 o1 = (float*) ((uintptr_t) o0 + input_width);
412 o2 = (float*) ((uintptr_t) o1 + input_width);
413 o3 = (float*) ((uintptr_t) o2 + input_width);
414 o4 = (float*) ((uintptr_t) o3 + input_width);
415 o5 = (float*) ((uintptr_t) o4 + input_width);
416
417 output_height = doz(output_height, 6);
418 } while (output_height != 0);
419 }