Debian Codegraph @

src/f32-velu/gen/f32-velu-neon-rr2-lut16-p3-u24.c

raw symbols SCIP
1 // Auto-generated file. Do not edit!
2 // Template: src/f32-velu/neon-lut16-p3.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/vunary.h"
15 #include "xnnpack/common.h"
16
17
18 extern XNN_INTERNAL const uint32_t xnn_table_exp2minus_k_over_16[16];
19
20 void xnn_f32_velu_ukernel__neon_rr2_lut16_p3_u24(
21 size_t batch,
22 const float* input,
23 float* output,
24 const struct xnn_f32_elu_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
25 {
26 assert(batch != 0);
27 assert(batch % sizeof(float) == 0);
28 assert(input != NULL);
29 assert(output != NULL);
30
31 const float32x4_t vsat_cutoff = vmovq_n_f32(-0x1.154246p+4f);
32 const float32x4_t vmagic_bias = vmovq_n_f32(0x1.800000p19f);
33 const float32x4_t vlog2e = vmovq_n_f32(0x1.715476p+0f);
34 const int32x4_t vindex_mask = vmovq_n_s32(INT32_C(0xF));
35 const float32x4_t vc3 = vmovq_n_f32(0x1.55561Cp-3f);
36 const float32x4_t vc2 = vmovq_n_f32(0x1.0001ECp-1f);
37 const float32x4_t vone = vmovq_n_f32(1.0f);
38
39 XNN_FORCE_REALIZATION(vsat_cutoff);
40 XNN_FORCE_REALIZATION(vmagic_bias);
41 XNN_FORCE_REALIZATION(vlog2e);
42 XNN_FORCE_REALIZATION(vc3);
43 XNN_FORCE_REALIZATION(vc2);
44 XNN_FORCE_REALIZATION(vone);
45
46 const float32x4_t vminus_ln2_hi = vmovq_n_f32(-0x1.62E400p-1f);
47 const float32x4_t vminus_ln2_lo = vmovq_n_f32(-0x1.7F7D1Cp-20f);
48 XNN_FORCE_REALIZATION(vminus_ln2_hi);
49 XNN_FORCE_REALIZATION(vminus_ln2_lo);
50
51 const float32x4_t vprescale = vld1q_dup_f32(&params->scalar.prescale);
52 const float32x4_t valpha = vld1q_dup_f32(&params->scalar.alpha);
53 const float32x4_t vbeta = vld1q_dup_f32(&params->scalar.beta);
54
55 for (; batch >= 24 * sizeof(float); batch -= 24 * sizeof(float)) {
56 float32x4_t vx0123 = vld1q_f32(input); input += 4;
57 float32x4_t vx4567 = vld1q_f32(input); input += 4;
58 float32x4_t vx89AB = vld1q_f32(input); input += 4;
59 float32x4_t vxCDEF = vld1q_f32(input); input += 4;
60 float32x4_t vxGHIJ = vld1q_f32(input); input += 4;
61 float32x4_t vxKLMN = vld1q_f32(input); input += 4;
62
63 const float32x4_t vz0123 = vmaxq_f32(vmulq_f32(vx0123, vprescale), vsat_cutoff);
64 const float32x4_t vz4567 = vmaxq_f32(vmulq_f32(vx4567, vprescale), vsat_cutoff);
65 const float32x4_t vz89AB = vmaxq_f32(vmulq_f32(vx89AB, vprescale), vsat_cutoff);
66 const float32x4_t vzCDEF = vmaxq_f32(vmulq_f32(vxCDEF, vprescale), vsat_cutoff);
67 const float32x4_t vzGHIJ = vmaxq_f32(vmulq_f32(vxGHIJ, vprescale), vsat_cutoff);
68 const float32x4_t vzKLMN = vmaxq_f32(vmulq_f32(vxKLMN, vprescale), vsat_cutoff);
69
70 float32x4_t vn0123 = vmlaq_f32(vmagic_bias, vz0123, vlog2e);
71 float32x4_t vn4567 = vmlaq_f32(vmagic_bias, vz4567, vlog2e);
72 float32x4_t vn89AB = vmlaq_f32(vmagic_bias, vz89AB, vlog2e);
73 float32x4_t vnCDEF = vmlaq_f32(vmagic_bias, vzCDEF, vlog2e);
74 float32x4_t vnGHIJ = vmlaq_f32(vmagic_bias, vzGHIJ, vlog2e);
75 float32x4_t vnKLMN = vmlaq_f32(vmagic_bias, vzKLMN, vlog2e);
76
77 const uint64x2_t vidx0123 = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vn0123), vindex_mask), 2));
78 const int32x4_t ven0123 = vshlq_n_s32(vreinterpretq_s32_f32(vn0123), 19);
79 const uint64x2_t vidx4567 = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vn4567), vindex_mask), 2));
80 const int32x4_t ven4567 = vshlq_n_s32(vreinterpretq_s32_f32(vn4567), 19);
81 const uint64x2_t vidx89AB = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vn89AB), vindex_mask), 2));
82 const int32x4_t ven89AB = vshlq_n_s32(vreinterpretq_s32_f32(vn89AB), 19);
83 const uint64x2_t vidxCDEF = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vnCDEF), vindex_mask), 2));
84 const int32x4_t venCDEF = vshlq_n_s32(vreinterpretq_s32_f32(vnCDEF), 19);
85 const uint64x2_t vidxGHIJ = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vnGHIJ), vindex_mask), 2));
86 const int32x4_t venGHIJ = vshlq_n_s32(vreinterpretq_s32_f32(vnGHIJ), 19);
87 const uint64x2_t vidxKLMN = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vnKLMN), vindex_mask), 2));
88 const int32x4_t venKLMN = vshlq_n_s32(vreinterpretq_s32_f32(vnKLMN), 19);
89
90 const uint64_t vidx01 = vgetq_lane_u64(vidx0123, 0);
91 const uint64_t vidx23 = vgetq_lane_u64(vidx0123, 1);
92 int32x2_t vl01 = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx01));
93 int32x2_t vl23 = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx23));
94 vl01 = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx01 >> 32)), vl01, 1);
95 vl23 = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx23 >> 32)), vl23, 1);
96 const int32x4_t vl0123 = vcombine_s32(vl01, vl23);
97 const uint64_t vidx45 = vgetq_lane_u64(vidx4567, 0);
98 const uint64_t vidx67 = vgetq_lane_u64(vidx4567, 1);
99 int32x2_t vl45 = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx45));
100 int32x2_t vl67 = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx67));
101 vl45 = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx45 >> 32)), vl45, 1);
102 vl67 = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx67 >> 32)), vl67, 1);
103 const int32x4_t vl4567 = vcombine_s32(vl45, vl67);
104 const uint64_t vidx89 = vgetq_lane_u64(vidx89AB, 0);
105 const uint64_t vidxAB = vgetq_lane_u64(vidx89AB, 1);
106 int32x2_t vl89 = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx89));
107 int32x2_t vlAB = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxAB));
108 vl89 = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx89 >> 32)), vl89, 1);
109 vlAB = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxAB >> 32)), vlAB, 1);
110 const int32x4_t vl89AB = vcombine_s32(vl89, vlAB);
111 const uint64_t vidxCD = vgetq_lane_u64(vidxCDEF, 0);
112 const uint64_t vidxEF = vgetq_lane_u64(vidxCDEF, 1);
113 int32x2_t vlCD = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxCD));
114 int32x2_t vlEF = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxEF));
115 vlCD = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxCD >> 32)), vlCD, 1);
116 vlEF = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxEF >> 32)), vlEF, 1);
117 const int32x4_t vlCDEF = vcombine_s32(vlCD, vlEF);
118 const uint64_t vidxGH = vgetq_lane_u64(vidxGHIJ, 0);
119 const uint64_t vidxIJ = vgetq_lane_u64(vidxGHIJ, 1);
120 int32x2_t vlGH = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxGH));
121 int32x2_t vlIJ = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxIJ));
122 vlGH = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxGH >> 32)), vlGH, 1);
123 vlIJ = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxIJ >> 32)), vlIJ, 1);
124 const int32x4_t vlGHIJ = vcombine_s32(vlGH, vlIJ);
125 const uint64_t vidxKL = vgetq_lane_u64(vidxKLMN, 0);
126 const uint64_t vidxMN = vgetq_lane_u64(vidxKLMN, 1);
127 int32x2_t vlKL = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxKL));
128 int32x2_t vlMN = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidxMN));
129 vlKL = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxKL >> 32)), vlKL, 1);
130 vlMN = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidxMN >> 32)), vlMN, 1);
131 const int32x4_t vlKLMN = vcombine_s32(vlKL, vlMN);
132
133 vn0123 = vsubq_f32(vn0123, vmagic_bias);
134 float32x4_t vs0123 = vreinterpretq_f32_s32(vaddq_s32(vl0123, ven0123));
135 vn4567 = vsubq_f32(vn4567, vmagic_bias);
136 float32x4_t vs4567 = vreinterpretq_f32_s32(vaddq_s32(vl4567, ven4567));
137 vn89AB = vsubq_f32(vn89AB, vmagic_bias);
138 float32x4_t vs89AB = vreinterpretq_f32_s32(vaddq_s32(vl89AB, ven89AB));
139 vnCDEF = vsubq_f32(vnCDEF, vmagic_bias);
140 float32x4_t vsCDEF = vreinterpretq_f32_s32(vaddq_s32(vlCDEF, venCDEF));
141 vnGHIJ = vsubq_f32(vnGHIJ, vmagic_bias);
142 float32x4_t vsGHIJ = vreinterpretq_f32_s32(vaddq_s32(vlGHIJ, venGHIJ));
143 vnKLMN = vsubq_f32(vnKLMN, vmagic_bias);
144 float32x4_t vsKLMN = vreinterpretq_f32_s32(vaddq_s32(vlKLMN, venKLMN));
145
146 float32x4_t vt0123 = vmlaq_f32(vz0123, vn0123, vminus_ln2_hi);
147 float32x4_t vt4567 = vmlaq_f32(vz4567, vn4567, vminus_ln2_hi);
148 float32x4_t vt89AB = vmlaq_f32(vz89AB, vn89AB, vminus_ln2_hi);
149 float32x4_t vtCDEF = vmlaq_f32(vzCDEF, vnCDEF, vminus_ln2_hi);
150 float32x4_t vtGHIJ = vmlaq_f32(vzGHIJ, vnGHIJ, vminus_ln2_hi);
151 float32x4_t vtKLMN = vmlaq_f32(vzKLMN, vnKLMN, vminus_ln2_hi);
152
153 vt0123 = vmlaq_f32(vt0123, vn0123, vminus_ln2_lo);
154 vt4567 = vmlaq_f32(vt4567, vn4567, vminus_ln2_lo);
155 vt89AB = vmlaq_f32(vt89AB, vn89AB, vminus_ln2_lo);
156 vtCDEF = vmlaq_f32(vtCDEF, vnCDEF, vminus_ln2_lo);
157 vtGHIJ = vmlaq_f32(vtGHIJ, vnGHIJ, vminus_ln2_lo);
158 vtKLMN = vmlaq_f32(vtKLMN, vnKLMN, vminus_ln2_lo);
159
160 float32x4_t vp0123 = vmlaq_f32(vc2, vc3, vt0123);
161 float32x4_t vp4567 = vmlaq_f32(vc2, vc3, vt4567);
162 float32x4_t vp89AB = vmlaq_f32(vc2, vc3, vt89AB);
163 float32x4_t vpCDEF = vmlaq_f32(vc2, vc3, vtCDEF);
164 float32x4_t vpGHIJ = vmlaq_f32(vc2, vc3, vtGHIJ);
165 float32x4_t vpKLMN = vmlaq_f32(vc2, vc3, vtKLMN);
166
167 vp0123 = vmulq_f32(vp0123, vt0123);
168 vp4567 = vmulq_f32(vp4567, vt4567);
169 vp89AB = vmulq_f32(vp89AB, vt89AB);
170 vpCDEF = vmulq_f32(vpCDEF, vtCDEF);
171 vpGHIJ = vmulq_f32(vpGHIJ, vtGHIJ);
172 vpKLMN = vmulq_f32(vpKLMN, vtKLMN);
173
174 vt0123 = vmulq_f32(vt0123, vs0123);
175 vs0123 = vsubq_f32(vs0123, vone);
176 vt4567 = vmulq_f32(vt4567, vs4567);
177 vs4567 = vsubq_f32(vs4567, vone);
178 vt89AB = vmulq_f32(vt89AB, vs89AB);
179 vs89AB = vsubq_f32(vs89AB, vone);
180 vtCDEF = vmulq_f32(vtCDEF, vsCDEF);
181 vsCDEF = vsubq_f32(vsCDEF, vone);
182 vtGHIJ = vmulq_f32(vtGHIJ, vsGHIJ);
183 vsGHIJ = vsubq_f32(vsGHIJ, vone);
184 vtKLMN = vmulq_f32(vtKLMN, vsKLMN);
185 vsKLMN = vsubq_f32(vsKLMN, vone);
186
187 vp0123 = vmlaq_f32(vt0123, vp0123, vt0123);
188 vp4567 = vmlaq_f32(vt4567, vp4567, vt4567);
189 vp89AB = vmlaq_f32(vt89AB, vp89AB, vt89AB);
190 vpCDEF = vmlaq_f32(vtCDEF, vpCDEF, vtCDEF);
191 vpGHIJ = vmlaq_f32(vtGHIJ, vpGHIJ, vtGHIJ);
192 vpKLMN = vmlaq_f32(vtKLMN, vpKLMN, vtKLMN);
193
194 const float32x4_t ve0123 = vmulq_f32(vaddq_f32(vp0123, vs0123), valpha);
195 const float32x4_t ve4567 = vmulq_f32(vaddq_f32(vp4567, vs4567), valpha);
196 const float32x4_t ve89AB = vmulq_f32(vaddq_f32(vp89AB, vs89AB), valpha);
197 const float32x4_t veCDEF = vmulq_f32(vaddq_f32(vpCDEF, vsCDEF), valpha);
198 const float32x4_t veGHIJ = vmulq_f32(vaddq_f32(vpGHIJ, vsGHIJ), valpha);
199 const float32x4_t veKLMN = vmulq_f32(vaddq_f32(vpKLMN, vsKLMN), valpha);
200
201 const uint32x4_t vm0123 = vcltq_f32(vx0123, vmovq_n_f32(0.0f));
202 vx0123 = vmulq_f32(vx0123, vbeta);
203 const uint32x4_t vm4567 = vcltq_f32(vx4567, vmovq_n_f32(0.0f));
204 vx4567 = vmulq_f32(vx4567, vbeta);
205 const uint32x4_t vm89AB = vcltq_f32(vx89AB, vmovq_n_f32(0.0f));
206 vx89AB = vmulq_f32(vx89AB, vbeta);
207 const uint32x4_t vmCDEF = vcltq_f32(vxCDEF, vmovq_n_f32(0.0f));
208 vxCDEF = vmulq_f32(vxCDEF, vbeta);
209 const uint32x4_t vmGHIJ = vcltq_f32(vxGHIJ, vmovq_n_f32(0.0f));
210 vxGHIJ = vmulq_f32(vxGHIJ, vbeta);
211 const uint32x4_t vmKLMN = vcltq_f32(vxKLMN, vmovq_n_f32(0.0f));
212 vxKLMN = vmulq_f32(vxKLMN, vbeta);
213
214 const float32x4_t vy0123 = vbslq_f32(vm0123, ve0123, vx0123);
215 const float32x4_t vy4567 = vbslq_f32(vm4567, ve4567, vx4567);
216 const float32x4_t vy89AB = vbslq_f32(vm89AB, ve89AB, vx89AB);
217 const float32x4_t vyCDEF = vbslq_f32(vmCDEF, veCDEF, vxCDEF);
218 const float32x4_t vyGHIJ = vbslq_f32(vmGHIJ, veGHIJ, vxGHIJ);
219 const float32x4_t vyKLMN = vbslq_f32(vmKLMN, veKLMN, vxKLMN);
220
221 vst1q_f32(output, vy0123); output += 4;
222 vst1q_f32(output, vy4567); output += 4;
223 vst1q_f32(output, vy89AB); output += 4;
224 vst1q_f32(output, vyCDEF); output += 4;
225 vst1q_f32(output, vyGHIJ); output += 4;
226 vst1q_f32(output, vyKLMN); output += 4;
227 }
228 for (; batch >= 4 * sizeof(float); batch -= 4 * sizeof(float)) {
229 float32x4_t vx = vld1q_f32(input); input += 4;
230
231 const float32x4_t vz = vmaxq_f32(vmulq_f32(vx, vprescale), vsat_cutoff);
232
233 float32x4_t vn = vmlaq_f32(vmagic_bias, vz, vlog2e);
234 const uint64x2_t vidx = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vn), vindex_mask), 2));
235 const int32x4_t ven = vshlq_n_s32(vreinterpretq_s32_f32(vn), 19);
236
237 const uint64_t vidx_lo = vgetq_lane_u64(vidx, 0);
238 const uint64_t vidx_hi = vgetq_lane_u64(vidx, 1);
239 int32x2_t vl_lo = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx_lo));
240 int32x2_t vl_hi = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx_hi));
241 vl_lo = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx_lo >> 32)), vl_lo, 1);
242 vl_hi = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx_hi >> 32)), vl_hi, 1);
243
244 vn = vsubq_f32(vn, vmagic_bias);
245 const int32x4_t vl = vcombine_s32(vl_lo, vl_hi);
246
247 float32x4_t vt = vmlaq_f32(vz, vn, vminus_ln2_hi);
248 vt = vmlaq_f32(vt, vn, vminus_ln2_lo);
249 float32x4_t vs = vreinterpretq_f32_s32(vaddq_s32(vl, ven));
250
251 float32x4_t vp = vmlaq_f32(vc2, vc3, vt);
252 vp = vmulq_f32(vp, vt);
253
254 vt = vmulq_f32(vt, vs);
255 vs = vsubq_f32(vs, vone);
256 vp = vmlaq_f32(vt, vp, vt);
257 const float32x4_t ve = vmulq_f32(vaddq_f32(vp, vs), valpha);
258
259 const uint32x4_t vm = vcltq_f32(vx, vmovq_n_f32(0.0f));
260 vx = vmulq_f32(vx, vbeta);
261 const float32x4_t vy = vbslq_f32(vm, ve, vx);
262
263 vst1q_f32(output, vy); output += 4;
264 }
265 if XNN_UNLIKELY(batch != 0) {
266 float32x4_t vx = vld1q_f32(input);
267
268 const float32x4_t vz = vmaxq_f32(vmulq_f32(vx, vprescale), vsat_cutoff);
269
270 float32x4_t vn = vmlaq_f32(vmagic_bias, vz, vlog2e);
271 const uint64x2_t vidx = vreinterpretq_u64_s32(vshlq_n_s32(vandq_s32(vreinterpretq_s32_f32(vn), vindex_mask), 2));
272 const int32x4_t ven = vshlq_n_s32(vreinterpretq_s32_f32(vn), 19);
273
274 const uint64_t vidx_lo = vgetq_lane_u64(vidx, 0);
275 const uint64_t vidx_hi = vgetq_lane_u64(vidx, 1);
276 int32x2_t vl_lo = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx_lo));
277 int32x2_t vl_hi = vld1_dup_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) vidx_hi));
278 vl_lo = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx_lo >> 32)), vl_lo, 1);
279 vl_hi = vld1_lane_s32((const int32_t*) ((uintptr_t) xnn_table_exp2minus_k_over_16 + (uint32_t) (vidx_hi >> 32)), vl_hi, 1);
280
281 vn = vsubq_f32(vn, vmagic_bias);
282 const int32x4_t vl = vcombine_s32(vl_lo, vl_hi);
283
284 float32x4_t vt = vmlaq_f32(vz, vn, vminus_ln2_hi);
285 vt = vmlaq_f32(vt, vn, vminus_ln2_lo);
286 float32x4_t vs = vreinterpretq_f32_s32(vaddq_s32(vl, ven));
287
288 float32x4_t vp = vmlaq_f32(vc2, vc3, vt);
289 vp = vmulq_f32(vp, vt);
290
291 vt = vmulq_f32(vt, vs);
292 vs = vsubq_f32(vs, vone);
293 vp = vmlaq_f32(vt, vp, vt);
294 const float32x4_t ve = vmulq_f32(vaddq_f32(vp, vs), valpha);
295
296 const uint32x4_t vm = vcltq_f32(vx, vmovq_n_f32(0.0f));
297 vx = vmulq_f32(vx, vbeta);
298 const float32x4_t vy = vbslq_f32(vm, ve, vx);
299
300 float32x2_t vy_lo = vget_low_f32(vy);
301 if (batch & (2 * sizeof(float))) {
302 vst1_f32(output, vy_lo); output += 2;
303 vy_lo = vget_high_f32(vy);
304 }
305 if (batch & (1 * sizeof(float))) {
306 vst1_lane_f32(output, vy_lo, 0);
307 }
308 }
309 }