xref: /aosp_15_r20/external/XNNPACK/src/x8-lut/gen/lut-scalar-x1.c (revision 4bdc94577ba0e567308109d787f7fec7b531ce36)
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 
xnn_x8_lut_ukernel__scalar_x1(size_t n,const uint8_t * x,uint8_t * y,const uint8_t t[restrict XNN_MIN_ELEMENTS (256)])16 void xnn_x8_lut_ukernel__scalar_x1(
17     size_t n,
18     const uint8_t* x,
19     uint8_t* y,
20     const uint8_t t[restrict XNN_MIN_ELEMENTS(256)])
21 {
22   assert(n != 0);
23   assert(x != NULL);
24   assert(y != NULL);
25 
26   do {
27     const size_t vx = (size_t) *x++;
28     const uint32_t vt = (uint32_t) t[vx];
29     *y++ = (uint8_t) vt;
30     n -= sizeof(uint8_t);
31   } while (n != 0);
32 }
33