xref: /aosp_15_r20/external/XNNPACK/src/f32-vsqrt/gen/neonfma-nr2fma1adj-x40.c (revision 4bdc94577ba0e567308109d787f7fec7b531ce36)
1*4bdc9457SAndroid Build Coastguard Worker // Auto-generated file. Do not edit!
2*4bdc9457SAndroid Build Coastguard Worker //   Template: src/f32-vsqrt/neonfma-nr2fma1adj.c.in
3*4bdc9457SAndroid Build Coastguard Worker //   Generator: tools/xngen
4*4bdc9457SAndroid Build Coastguard Worker //
5*4bdc9457SAndroid Build Coastguard Worker // Copyright 2020 Google LLC
6*4bdc9457SAndroid Build Coastguard Worker //
7*4bdc9457SAndroid Build Coastguard Worker // This source code is licensed under the BSD-style license found in the
8*4bdc9457SAndroid Build Coastguard Worker // LICENSE file in the root directory of this source tree.
9*4bdc9457SAndroid Build Coastguard Worker 
10*4bdc9457SAndroid Build Coastguard Worker #include <assert.h>
11*4bdc9457SAndroid Build Coastguard Worker #include <math.h>
12*4bdc9457SAndroid Build Coastguard Worker 
13*4bdc9457SAndroid Build Coastguard Worker #include <arm_neon.h>
14*4bdc9457SAndroid Build Coastguard Worker 
15*4bdc9457SAndroid Build Coastguard Worker #include <xnnpack/common.h>
16*4bdc9457SAndroid Build Coastguard Worker #include <xnnpack/vunary.h>
17*4bdc9457SAndroid Build Coastguard Worker 
18*4bdc9457SAndroid Build Coastguard Worker 
xnn_f32_vsqrt_ukernel__neonfma_nr2fma1adj_x40(size_t n,const float * x,float * y,const union xnn_f32_sqrt_params params[restrict XNN_MIN_ELEMENTS (1)])19*4bdc9457SAndroid Build Coastguard Worker void xnn_f32_vsqrt_ukernel__neonfma_nr2fma1adj_x40(
20*4bdc9457SAndroid Build Coastguard Worker     size_t n,
21*4bdc9457SAndroid Build Coastguard Worker     const float* x,
22*4bdc9457SAndroid Build Coastguard Worker     float* y,
23*4bdc9457SAndroid Build Coastguard Worker     const union xnn_f32_sqrt_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
24*4bdc9457SAndroid Build Coastguard Worker {
25*4bdc9457SAndroid Build Coastguard Worker   assert(n != 0);
26*4bdc9457SAndroid Build Coastguard Worker   assert(n % sizeof(float) == 0);
27*4bdc9457SAndroid Build Coastguard Worker 
28*4bdc9457SAndroid Build Coastguard Worker   const float32x4_t vhalf = vmovq_n_f32(0.5f);
29*4bdc9457SAndroid Build Coastguard Worker   for (; n >= 40 * sizeof(float); n -= 40 * sizeof(float)) {
30*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vx0123 = vld1q_f32(x); x += 4;
31*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vx4567 = vld1q_f32(x); x += 4;
32*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vx89AB = vld1q_f32(x); x += 4;
33*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vxCDEF = vld1q_f32(x); x += 4;
34*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vxGHIJ = vld1q_f32(x); x += 4;
35*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vxKLMN = vld1q_f32(x); x += 4;
36*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vxOPQR = vld1q_f32(x); x += 4;
37*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vxSTUV = vld1q_f32(x); x += 4;
38*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vxWXYZ = vld1q_f32(x); x += 4;
39*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vx = vld1q_f32(x); x += 4;
40*4bdc9457SAndroid Build Coastguard Worker 
41*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtx0123 = vrsqrteq_f32(vx0123);
42*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtx4567 = vrsqrteq_f32(vx4567);
43*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtx89AB = vrsqrteq_f32(vx89AB);
44*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtxCDEF = vrsqrteq_f32(vxCDEF);
45*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtxGHIJ = vrsqrteq_f32(vxGHIJ);
46*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtxKLMN = vrsqrteq_f32(vxKLMN);
47*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtxOPQR = vrsqrteq_f32(vxOPQR);
48*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtxSTUV = vrsqrteq_f32(vxSTUV);
49*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtxWXYZ = vrsqrteq_f32(vxWXYZ);
50*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtx = vrsqrteq_f32(vx);
51*4bdc9457SAndroid Build Coastguard Worker 
52*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtx0123 = vmulq_f32(vrsqrtx0123, vx0123);
53*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtx0123 = vmulq_f32(vrsqrtx0123, vhalf);
54*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtx4567 = vmulq_f32(vrsqrtx4567, vx4567);
55*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtx4567 = vmulq_f32(vrsqrtx4567, vhalf);
56*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtx89AB = vmulq_f32(vrsqrtx89AB, vx89AB);
57*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtx89AB = vmulq_f32(vrsqrtx89AB, vhalf);
58*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtxCDEF = vmulq_f32(vrsqrtxCDEF, vxCDEF);
59*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtxCDEF = vmulq_f32(vrsqrtxCDEF, vhalf);
60*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtxGHIJ = vmulq_f32(vrsqrtxGHIJ, vxGHIJ);
61*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtxGHIJ = vmulq_f32(vrsqrtxGHIJ, vhalf);
62*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtxKLMN = vmulq_f32(vrsqrtxKLMN, vxKLMN);
63*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtxKLMN = vmulq_f32(vrsqrtxKLMN, vhalf);
64*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtxOPQR = vmulq_f32(vrsqrtxOPQR, vxOPQR);
65*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtxOPQR = vmulq_f32(vrsqrtxOPQR, vhalf);
66*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtxSTUV = vmulq_f32(vrsqrtxSTUV, vxSTUV);
67*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtxSTUV = vmulq_f32(vrsqrtxSTUV, vhalf);
68*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtxWXYZ = vmulq_f32(vrsqrtxWXYZ, vxWXYZ);
69*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtxWXYZ = vmulq_f32(vrsqrtxWXYZ, vhalf);
70*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtx = vmulq_f32(vrsqrtx, vx);
71*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtx = vmulq_f32(vrsqrtx, vhalf);
72*4bdc9457SAndroid Build Coastguard Worker 
73*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidual0123 = vfmsq_f32(vhalf, vsqrtx0123, vhalfrsqrtx0123);
74*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidual4567 = vfmsq_f32(vhalf, vsqrtx4567, vhalfrsqrtx4567);
75*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidual89AB = vfmsq_f32(vhalf, vsqrtx89AB, vhalfrsqrtx89AB);
76*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidualCDEF = vfmsq_f32(vhalf, vsqrtxCDEF, vhalfrsqrtxCDEF);
77*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidualGHIJ = vfmsq_f32(vhalf, vsqrtxGHIJ, vhalfrsqrtxGHIJ);
78*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidualKLMN = vfmsq_f32(vhalf, vsqrtxKLMN, vhalfrsqrtxKLMN);
79*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidualOPQR = vfmsq_f32(vhalf, vsqrtxOPQR, vhalfrsqrtxOPQR);
80*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidualSTUV = vfmsq_f32(vhalf, vsqrtxSTUV, vhalfrsqrtxSTUV);
81*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidualWXYZ = vfmsq_f32(vhalf, vsqrtxWXYZ, vhalfrsqrtxWXYZ);
82*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidual = vfmsq_f32(vhalf, vsqrtx, vhalfrsqrtx);
83*4bdc9457SAndroid Build Coastguard Worker 
84*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx0123 = vfmaq_f32(vhalfrsqrtx0123, vresidual0123, vhalfrsqrtx0123);
85*4bdc9457SAndroid Build Coastguard Worker     vsqrtx0123 = vfmaq_f32(vsqrtx0123, vresidual0123, vsqrtx0123);
86*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx4567 = vfmaq_f32(vhalfrsqrtx4567, vresidual4567, vhalfrsqrtx4567);
87*4bdc9457SAndroid Build Coastguard Worker     vsqrtx4567 = vfmaq_f32(vsqrtx4567, vresidual4567, vsqrtx4567);
88*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx89AB = vfmaq_f32(vhalfrsqrtx89AB, vresidual89AB, vhalfrsqrtx89AB);
89*4bdc9457SAndroid Build Coastguard Worker     vsqrtx89AB = vfmaq_f32(vsqrtx89AB, vresidual89AB, vsqrtx89AB);
90*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxCDEF = vfmaq_f32(vhalfrsqrtxCDEF, vresidualCDEF, vhalfrsqrtxCDEF);
91*4bdc9457SAndroid Build Coastguard Worker     vsqrtxCDEF = vfmaq_f32(vsqrtxCDEF, vresidualCDEF, vsqrtxCDEF);
92*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxGHIJ = vfmaq_f32(vhalfrsqrtxGHIJ, vresidualGHIJ, vhalfrsqrtxGHIJ);
93*4bdc9457SAndroid Build Coastguard Worker     vsqrtxGHIJ = vfmaq_f32(vsqrtxGHIJ, vresidualGHIJ, vsqrtxGHIJ);
94*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxKLMN = vfmaq_f32(vhalfrsqrtxKLMN, vresidualKLMN, vhalfrsqrtxKLMN);
95*4bdc9457SAndroid Build Coastguard Worker     vsqrtxKLMN = vfmaq_f32(vsqrtxKLMN, vresidualKLMN, vsqrtxKLMN);
96*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxOPQR = vfmaq_f32(vhalfrsqrtxOPQR, vresidualOPQR, vhalfrsqrtxOPQR);
97*4bdc9457SAndroid Build Coastguard Worker     vsqrtxOPQR = vfmaq_f32(vsqrtxOPQR, vresidualOPQR, vsqrtxOPQR);
98*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxSTUV = vfmaq_f32(vhalfrsqrtxSTUV, vresidualSTUV, vhalfrsqrtxSTUV);
99*4bdc9457SAndroid Build Coastguard Worker     vsqrtxSTUV = vfmaq_f32(vsqrtxSTUV, vresidualSTUV, vsqrtxSTUV);
100*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxWXYZ = vfmaq_f32(vhalfrsqrtxWXYZ, vresidualWXYZ, vhalfrsqrtxWXYZ);
101*4bdc9457SAndroid Build Coastguard Worker     vsqrtxWXYZ = vfmaq_f32(vsqrtxWXYZ, vresidualWXYZ, vsqrtxWXYZ);
102*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx = vfmaq_f32(vhalfrsqrtx, vresidual, vhalfrsqrtx);
103*4bdc9457SAndroid Build Coastguard Worker     vsqrtx = vfmaq_f32(vsqrtx, vresidual, vsqrtx);
104*4bdc9457SAndroid Build Coastguard Worker 
105*4bdc9457SAndroid Build Coastguard Worker     vresidual0123 = vfmsq_f32(vhalf, vsqrtx0123, vhalfrsqrtx0123);
106*4bdc9457SAndroid Build Coastguard Worker     vresidual4567 = vfmsq_f32(vhalf, vsqrtx4567, vhalfrsqrtx4567);
107*4bdc9457SAndroid Build Coastguard Worker     vresidual89AB = vfmsq_f32(vhalf, vsqrtx89AB, vhalfrsqrtx89AB);
108*4bdc9457SAndroid Build Coastguard Worker     vresidualCDEF = vfmsq_f32(vhalf, vsqrtxCDEF, vhalfrsqrtxCDEF);
109*4bdc9457SAndroid Build Coastguard Worker     vresidualGHIJ = vfmsq_f32(vhalf, vsqrtxGHIJ, vhalfrsqrtxGHIJ);
110*4bdc9457SAndroid Build Coastguard Worker     vresidualKLMN = vfmsq_f32(vhalf, vsqrtxKLMN, vhalfrsqrtxKLMN);
111*4bdc9457SAndroid Build Coastguard Worker     vresidualOPQR = vfmsq_f32(vhalf, vsqrtxOPQR, vhalfrsqrtxOPQR);
112*4bdc9457SAndroid Build Coastguard Worker     vresidualSTUV = vfmsq_f32(vhalf, vsqrtxSTUV, vhalfrsqrtxSTUV);
113*4bdc9457SAndroid Build Coastguard Worker     vresidualWXYZ = vfmsq_f32(vhalf, vsqrtxWXYZ, vhalfrsqrtxWXYZ);
114*4bdc9457SAndroid Build Coastguard Worker     vresidual = vfmsq_f32(vhalf, vsqrtx, vhalfrsqrtx);
115*4bdc9457SAndroid Build Coastguard Worker 
116*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx0123 = vfmaq_f32(vhalfrsqrtx0123, vresidual0123, vhalfrsqrtx0123);
117*4bdc9457SAndroid Build Coastguard Worker     vsqrtx0123 = vfmaq_f32(vsqrtx0123, vresidual0123, vsqrtx0123);
118*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx4567 = vfmaq_f32(vhalfrsqrtx4567, vresidual4567, vhalfrsqrtx4567);
119*4bdc9457SAndroid Build Coastguard Worker     vsqrtx4567 = vfmaq_f32(vsqrtx4567, vresidual4567, vsqrtx4567);
120*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx89AB = vfmaq_f32(vhalfrsqrtx89AB, vresidual89AB, vhalfrsqrtx89AB);
121*4bdc9457SAndroid Build Coastguard Worker     vsqrtx89AB = vfmaq_f32(vsqrtx89AB, vresidual89AB, vsqrtx89AB);
122*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxCDEF = vfmaq_f32(vhalfrsqrtxCDEF, vresidualCDEF, vhalfrsqrtxCDEF);
123*4bdc9457SAndroid Build Coastguard Worker     vsqrtxCDEF = vfmaq_f32(vsqrtxCDEF, vresidualCDEF, vsqrtxCDEF);
124*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxGHIJ = vfmaq_f32(vhalfrsqrtxGHIJ, vresidualGHIJ, vhalfrsqrtxGHIJ);
125*4bdc9457SAndroid Build Coastguard Worker     vsqrtxGHIJ = vfmaq_f32(vsqrtxGHIJ, vresidualGHIJ, vsqrtxGHIJ);
126*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxKLMN = vfmaq_f32(vhalfrsqrtxKLMN, vresidualKLMN, vhalfrsqrtxKLMN);
127*4bdc9457SAndroid Build Coastguard Worker     vsqrtxKLMN = vfmaq_f32(vsqrtxKLMN, vresidualKLMN, vsqrtxKLMN);
128*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxOPQR = vfmaq_f32(vhalfrsqrtxOPQR, vresidualOPQR, vhalfrsqrtxOPQR);
129*4bdc9457SAndroid Build Coastguard Worker     vsqrtxOPQR = vfmaq_f32(vsqrtxOPQR, vresidualOPQR, vsqrtxOPQR);
130*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxSTUV = vfmaq_f32(vhalfrsqrtxSTUV, vresidualSTUV, vhalfrsqrtxSTUV);
131*4bdc9457SAndroid Build Coastguard Worker     vsqrtxSTUV = vfmaq_f32(vsqrtxSTUV, vresidualSTUV, vsqrtxSTUV);
132*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtxWXYZ = vfmaq_f32(vhalfrsqrtxWXYZ, vresidualWXYZ, vhalfrsqrtxWXYZ);
133*4bdc9457SAndroid Build Coastguard Worker     vsqrtxWXYZ = vfmaq_f32(vsqrtxWXYZ, vresidualWXYZ, vsqrtxWXYZ);
134*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx = vfmaq_f32(vhalfrsqrtx, vresidual, vhalfrsqrtx);
135*4bdc9457SAndroid Build Coastguard Worker     vsqrtx = vfmaq_f32(vsqrtx, vresidual, vsqrtx);
136*4bdc9457SAndroid Build Coastguard Worker 
137*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustment0123 = vfmsq_f32(vx0123, vsqrtx0123, vsqrtx0123);
138*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustment4567 = vfmsq_f32(vx4567, vsqrtx4567, vsqrtx4567);
139*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustment89AB = vfmsq_f32(vx89AB, vsqrtx89AB, vsqrtx89AB);
140*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustmentCDEF = vfmsq_f32(vxCDEF, vsqrtxCDEF, vsqrtxCDEF);
141*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustmentGHIJ = vfmsq_f32(vxGHIJ, vsqrtxGHIJ, vsqrtxGHIJ);
142*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustmentKLMN = vfmsq_f32(vxKLMN, vsqrtxKLMN, vsqrtxKLMN);
143*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustmentOPQR = vfmsq_f32(vxOPQR, vsqrtxOPQR, vsqrtxOPQR);
144*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustmentSTUV = vfmsq_f32(vxSTUV, vsqrtxSTUV, vsqrtxSTUV);
145*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustmentWXYZ = vfmsq_f32(vxWXYZ, vsqrtxWXYZ, vsqrtxWXYZ);
146*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustment = vfmsq_f32(vx, vsqrtx, vsqrtx);
147*4bdc9457SAndroid Build Coastguard Worker 
148*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vy0123 = vfmaq_f32(vsqrtx0123, vhalfrsqrtx0123, vadjustment0123);
149*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vy4567 = vfmaq_f32(vsqrtx4567, vhalfrsqrtx4567, vadjustment4567);
150*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vy89AB = vfmaq_f32(vsqrtx89AB, vhalfrsqrtx89AB, vadjustment89AB);
151*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vyCDEF = vfmaq_f32(vsqrtxCDEF, vhalfrsqrtxCDEF, vadjustmentCDEF);
152*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vyGHIJ = vfmaq_f32(vsqrtxGHIJ, vhalfrsqrtxGHIJ, vadjustmentGHIJ);
153*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vyKLMN = vfmaq_f32(vsqrtxKLMN, vhalfrsqrtxKLMN, vadjustmentKLMN);
154*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vyOPQR = vfmaq_f32(vsqrtxOPQR, vhalfrsqrtxOPQR, vadjustmentOPQR);
155*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vySTUV = vfmaq_f32(vsqrtxSTUV, vhalfrsqrtxSTUV, vadjustmentSTUV);
156*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vyWXYZ = vfmaq_f32(vsqrtxWXYZ, vhalfrsqrtxWXYZ, vadjustmentWXYZ);
157*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vy = vfmaq_f32(vsqrtx, vhalfrsqrtx, vadjustment);
158*4bdc9457SAndroid Build Coastguard Worker 
159*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vy0123); y += 4;
160*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vy4567); y += 4;
161*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vy89AB); y += 4;
162*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vyCDEF); y += 4;
163*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vyGHIJ); y += 4;
164*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vyKLMN); y += 4;
165*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vyOPQR); y += 4;
166*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vySTUV); y += 4;
167*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vyWXYZ); y += 4;
168*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vy); y += 4;
169*4bdc9457SAndroid Build Coastguard Worker   }
170*4bdc9457SAndroid Build Coastguard Worker   for (; n >= 4 * sizeof(float); n -= 4 * sizeof(float)) {
171*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vx = vld1q_f32(x); x += 4;
172*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtx = vrsqrteq_f32(vx);
173*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtx = vmulq_f32(vrsqrtx, vx);
174*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtx = vmulq_f32(vrsqrtx, vhalf);
175*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidual = vfmsq_f32(vhalf, vsqrtx, vhalfrsqrtx);
176*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx = vfmaq_f32(vhalfrsqrtx, vresidual, vhalfrsqrtx);
177*4bdc9457SAndroid Build Coastguard Worker     vsqrtx = vfmaq_f32(vsqrtx, vresidual, vsqrtx);
178*4bdc9457SAndroid Build Coastguard Worker     vresidual = vfmsq_f32(vhalf, vsqrtx, vhalfrsqrtx);
179*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx = vfmaq_f32(vhalfrsqrtx, vresidual, vhalfrsqrtx);
180*4bdc9457SAndroid Build Coastguard Worker     vsqrtx = vfmaq_f32(vsqrtx, vresidual, vsqrtx);
181*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustment = vfmsq_f32(vx, vsqrtx, vsqrtx);
182*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vy = vfmaq_f32(vsqrtx, vhalfrsqrtx, vadjustment);
183*4bdc9457SAndroid Build Coastguard Worker     vst1q_f32(y, vy); y += 4;
184*4bdc9457SAndroid Build Coastguard Worker   }
185*4bdc9457SAndroid Build Coastguard Worker   if XNN_UNLIKELY(n != 0) {
186*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vx = vld1q_f32(x);
187*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vrsqrtx = vrsqrteq_f32(vx);
188*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vsqrtx = vmulq_f32(vrsqrtx, vx);
189*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vhalfrsqrtx = vmulq_f32(vrsqrtx, vhalf);
190*4bdc9457SAndroid Build Coastguard Worker     float32x4_t vresidual = vfmsq_f32(vhalf, vsqrtx, vhalfrsqrtx);
191*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx = vfmaq_f32(vhalfrsqrtx, vresidual, vhalfrsqrtx);
192*4bdc9457SAndroid Build Coastguard Worker     vsqrtx = vfmaq_f32(vsqrtx, vresidual, vsqrtx);
193*4bdc9457SAndroid Build Coastguard Worker     vresidual = vfmsq_f32(vhalf, vsqrtx, vhalfrsqrtx);
194*4bdc9457SAndroid Build Coastguard Worker     vhalfrsqrtx = vfmaq_f32(vhalfrsqrtx, vresidual, vhalfrsqrtx);
195*4bdc9457SAndroid Build Coastguard Worker     vsqrtx = vfmaq_f32(vsqrtx, vresidual, vsqrtx);
196*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vadjustment = vfmsq_f32(vx, vsqrtx, vsqrtx);
197*4bdc9457SAndroid Build Coastguard Worker     const float32x4_t vy = vfmaq_f32(vsqrtx, vhalfrsqrtx, vadjustment);
198*4bdc9457SAndroid Build Coastguard Worker 
199*4bdc9457SAndroid Build Coastguard Worker     float32x2_t vy_lo = vget_low_f32(vy);
200*4bdc9457SAndroid Build Coastguard Worker     if (n & (2 * sizeof(float))) {
201*4bdc9457SAndroid Build Coastguard Worker       vst1_f32(y, vy_lo); y += 2;
202*4bdc9457SAndroid Build Coastguard Worker       vy_lo = vget_high_f32(vy);
203*4bdc9457SAndroid Build Coastguard Worker     }
204*4bdc9457SAndroid Build Coastguard Worker     if (n & (1 * sizeof(float))) {
205*4bdc9457SAndroid Build Coastguard Worker       vst1_lane_f32(y, vy_lo, 0);
206*4bdc9457SAndroid Build Coastguard Worker     }
207*4bdc9457SAndroid Build Coastguard Worker   }
208*4bdc9457SAndroid Build Coastguard Worker }
209