Debian Codegraph @

src/f32-vbinary/gen/f32-vdivc-aarch64-neon-u4.c

raw symbols SCIP
1 // Auto-generated file. Do not edit!
2 // Template: src/f32-vbinary/vopc-neon.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2019 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/common.h"
15 #include "xnnpack/vbinary.h"
16
17
18 void xnn_f32_vdivc_ukernel__aarch64_neon_u4(
19 size_t batch,
20 const float* input_a,
21 const float* input_b,
22 float* output,
23 const struct xnn_f32_default_params params[restrict XNN_MIN_ELEMENTS(1)]) XNN_OOB_READS
24 {
25 assert(batch != 0);
26 assert(batch % sizeof(float) == 0);
27 assert(input_a != NULL);
28 assert(input_b != NULL);
29 assert(output != NULL);
30
31 const float32x4_t vb = vld1q_dup_f32(input_b);
32
33 for (; batch >= 4 * sizeof(float); batch -= 4 * sizeof(float)) {
34 const float32x4_t va = vld1q_f32(input_a); input_a += 4;
35
36 float32x4_t vacc = vdivq_f32(va, vb);
37
38 vst1q_f32(output, vacc); output += 4;
39 }
40 if XNN_UNLIKELY(batch != 0) {
41 const float32x4_t va = vld1q_f32(input_a);
42
43 float32x4_t vacc = vdivq_f32(va, vb);
44
45 float32x2_t vacc_lo = vget_low_f32(vacc);
46 if (batch & (2 * sizeof(float))) {
47 vst1_f32(output, vacc_lo); output += 2;
48 vacc_lo = vget_high_f32(vacc);
49 }
50 if (batch & (1 * sizeof(float))) {
51 vst1_lane_f32(output, vacc_lo, 0);
52 }
53 }
54 }