Debian Codegraph @

src/x8-lut/gen/x8-lut-scalar-u1.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/x8-lut/scalar.c.in
3 // Generator: tools/xngen
4 //
5 // Copyright 2021 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/lut.h"
13 #include "xnnpack/common.h"
14
15
16 void xnn_x8_lut_ukernel__scalar_u1(
17 size_t batch,
18 const uint8_t* input,
19 uint8_t* output,
20 const uint8_t table[restrict XNN_MIN_ELEMENTS(256)])
21 {
22 assert(batch != 0);
23 assert(batch % sizeof(uint8_t) == 0);
24 assert(input != NULL);
25 assert(output != NULL);
26
27 do {
28 const size_t vx = (size_t) *input++;
29 const uint32_t vt = (uint32_t) table[vx];
30 *output++ = (uint8_t) vt;
31 batch -= sizeof(uint8_t);
32 } while (batch != 0);
33 }