Debian Codegraph @

src/x32-zerob/gen/x32-zerob-4c1s1r-gemm-scalar-int.c

raw
1 // Auto-generated file. Do not edit!
2 // Template: src/x32-packb/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 #include <stddef.h>
12
13 #include "xnnpack/math.h"
14 #include "xnnpack/packb.h"
15 #include "xnnpack/unaligned.h"
16
17 void xnn_x32_zerob_gemm_ukernel_4c1s1r__scalar_int(
18 size_t groups,
19 size_t channels,
20 uint32_t* packed_weights,
21 size_t channel_tile_stride,
22 size_t channel_subtile_stride,
23 const struct xnn_x32_packb_params params[restrict XNN_MIN_ELEMENTS(1)])
24 {
25 assert(groups != 0);
26 assert(channels != 0);
27 assert(packed_weights != NULL);
28
29 uint32_t* w = (uint32_t*) packed_weights;
30 const uint32_t vzero = 0;
31 do {
32 // channel tile loop multiple of 4
33 size_t c = channels;
34 for (; c >= 4; c -= 4) {
35 unaligned_indexed_store_u32(w, 0, vzero);
36 unaligned_indexed_store_u32(w, 1, vzero);
37 unaligned_indexed_store_u32(w, 2, vzero);
38 unaligned_indexed_store_u32(w, 3, vzero);
39
40 w = (uint32_t*) ((uintptr_t) w + channel_tile_stride);
41 }
42
43 // channel subtile loop multiple of 1
44 for (; c >= 1; c -= 1) {
45 unaligned_indexed_store_u32(w, 0, vzero);
46
47 w = (uint32_t*) ((uintptr_t) w + channel_subtile_stride);
48 }
49
50 } while (--groups != 0);
51 }