xref: /aosp_15_r20/external/XNNPACK/src/f32-vsqrt/gen/scalar-sqrt-x1.c (revision 4bdc94577ba0e567308109d787f7fec7b531ce36)
1 // Auto-generated file. Do not edit!
2 //   Template: src/f32-vsqrt/scalar-sqrt.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 #include <math.h>
12 
13 #include <xnnpack/common.h>
14 #include <xnnpack/vunary.h>
15 
16 
xnn_f32_vsqrt_ukernel__scalar_sqrt_x1(size_t n,const float * x,float * y,const union xnn_f32_sqrt_params params[restrict XNN_MIN_ELEMENTS (1)])17 void xnn_f32_vsqrt_ukernel__scalar_sqrt_x1(
18     size_t n,
19     const float* x,
20     float* y,
21     const union xnn_f32_sqrt_params params[restrict XNN_MIN_ELEMENTS(1)])
22 {
23   assert(n != 0);
24   assert(n % sizeof(float) == 0);
25 
26   for (; n >= sizeof(float); n -= sizeof(float)) {
27     const float vx = *x++;
28     const float vy = sqrtf(vx);
29     *y++ = vy;
30   }
31 }
32