Debian Codegraph @

src/f16-vbinary/gen/f16-vrdivc-fp16arith-u4.c

raw symbols SCIP
1 // Auto-generated file. Do not edit!
2 // Template: src/f16-vbinary/vopc-fp16arith.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2022 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_fp16.h>
13
14 #include "xnnpack/common.h"
15 #include "xnnpack/intrinsics-polyfill.h"
16 #include "xnnpack/math.h"
17 #include "xnnpack/vbinary.h"
18
19
20 void xnn_f16_vrdivc_ukernel__fp16arith_u4(
21 size_t batch,
22 const xnn_float16* restrict input_a,
23 const xnn_float16* restrict input_b,
24 xnn_float16* restrict output,
25 const struct xnn_f16_default_params params[restrict XNN_MIN_ELEMENTS(1)])
26 {
27 assert(batch != 0);
28 assert(batch % sizeof(float16_t) == 0);
29 assert(input_a != NULL);
30 assert(input_b != NULL);
31 assert(output != NULL);
32
33 const float16_t* a = (const float16_t*) input_a;
34 const float16_t* b = (const float16_t*) input_b;
35 float16_t* o = (float16_t*) output;
36
37 const float16_t vb = *b;
38 for (; batch >= 4 * sizeof(float16_t); batch -= 4 * sizeof(float16_t)) {
39 float16_t vacc0 = a[0];
40 float16_t vacc1 = a[1];
41 float16_t vacc2 = a[2];
42 float16_t vacc3 = a[3];
43 a += 4;
44
45 vacc0 = vdivh_f16(vb, vacc0);
46 vacc1 = vdivh_f16(vb, vacc1);
47 vacc2 = vdivh_f16(vb, vacc2);
48 vacc3 = vdivh_f16(vb, vacc3);
49
50
51 o[0] = vacc0;
52 o[1] = vacc1;
53 o[2] = vacc2;
54 o[3] = vacc3;
55 o += 4;
56 }
57 if XNN_UNLIKELY(batch != 0) {
58 do {
59 float16_t vacc = *a++;
60 vacc = vdivh_f16(vb, vacc);
61 *o++ = vacc;
62 batch -= sizeof(float16_t);
63 } while (batch != 0);
64 }
65 }