xref: /aosp_15_r20/external/XNNPACK/src/x32-zip/xm-scalar.c (revision 4bdc94577ba0e567308109d787f7fec7b531ce36)
1 // Copyright 2019 Google LLC
2 //
3 // This source code is licensed under the BSD-style license found in the
4 // LICENSE file in the root directory of this source tree.
5 
6 #include <assert.h>
7 
8 #include <xnnpack/zip.h>
9 
10 
xnn_x32_zip_xm_ukernel__scalar(size_t n,size_t m,const uint32_t * input,uint32_t * output)11 void xnn_x32_zip_xm_ukernel__scalar(
12     size_t n,
13     size_t m,
14     const uint32_t* input,
15     uint32_t* output)
16 {
17   assert(n != 0);
18   assert(n % 4 == 0);
19   assert(m >= 4);
20 
21   size_t k = n;
22   do {
23     size_t l = m;
24     const uint32_t* input_column = input++;
25     do {
26       *output++ = *input_column;
27       input_column = (uint32_t*) ((uintptr_t) input_column + n);
28     } while (--l != 0);
29     k -= 4;
30   } while (k != 0);
31 }
32