Debian Codegraph @

src/f32-rminmax/gen/f32-rmax-wasm-u2-acc2.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/f32-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/reduce.h"
14
15 void xnn_f32_rmax_ukernel__wasm_u2_acc2(
16 size_t batch,
17 const float* input,
18 float* output,
19 const struct xnn_f32_default_params params[restrict XNN_MIN_ELEMENTS(1)])
20 {
21 assert(batch != 0);
22 assert(batch % sizeof(float) == 0);
23 assert(input != NULL);
24 assert(output != NULL);
25
26 const float* i = input;
27
28 float vmax0 = *i;
29 float vmax1 = vmax0;
30 for (; batch >= 2 * sizeof(float); batch -= 2 * sizeof(float)) {
31 const float vt0 = i[0];
32 const float vt1 = i[1];
33 i += 2;
34
35 vmax0 = __builtin_wasm_max_f32(vmax0, vt0);
36 vmax1 = __builtin_wasm_max_f32(vmax1, vt1);
37 }
38 vmax0 = __builtin_wasm_max_f32(vmax0, vmax1);
39
40 if XNN_UNLIKELY(batch != 0) {
41 const float vt = *i;
42 vmax0 = __builtin_wasm_max_f32(vmax0, vt);
43 }
44 output[0] = vmax0;
45 }