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/packx.h> 9 10 xnn_x32_packx_ukernel_2x__scalar(size_t m,size_t k,const uint32_t * restrict x,size_t x_stride,uint32_t * restrict y)11void xnn_x32_packx_ukernel_2x__scalar( 12 size_t m, 13 size_t k, 14 const uint32_t* restrict x, 15 size_t x_stride, 16 uint32_t* restrict y) 17 { 18 assert(m != 0); 19 assert(k != 0); 20 21 const float* x0 = (const float*) x; 22 const float* x1 = (const float*) ((uintptr_t) x0 + x_stride); 23 if (m != 2) { 24 x1 = x0; 25 } 26 27 float*restrict y_f32 = (float*) y; 28 29 do { 30 const float vx0 = *x0++; 31 const float vx1 = *x1++; 32 33 y_f32[0] = vx0; 34 y_f32[1] = vx1; 35 y_f32 += 2; 36 } while (--k != 0); 37 } 38