Debian Codegraph @

src/f16-rminmax/gen/f16-rmax-scalar-u1.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/f16-rminmax/scalar.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2023 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 "xnnpack/common.h"
13 #include "xnnpack/math.h"
14 #include "xnnpack/reduce.h"
15
16
17 void xnn_f16_rmax_ukernel__scalar_u1(
18 size_t batch,
19 const xnn_float16* input,
20 xnn_float16* output,
21 const struct xnn_f16_default_params params[restrict XNN_MIN_ELEMENTS(1)])
22 {
23 assert(batch != 0);
24 assert(batch % sizeof(uint16_t) == 0);
25 assert(input != NULL);
26 assert(output != NULL);
27
28 const uint16_t* i = (const uint16_t*) input;
29 uint16_t* o = (uint16_t*) output;
30
31 int16_t vt = math_signcomplement_f16(*i);
32 int16_t vmax0 = vt;
33 do {
34 vt = math_signcomplement_f16(*i++);
35 vmax0 = math_max_s16(vmax0, vt);
36 batch -= sizeof(uint16_t);
37 } while (batch != 0);
38 o[0] = (uint16_t) math_signcomplement_f16((uint16_t) vmax0);
39 }