1 // Auto-generated file. Do not edit! 2 // Template: src/qs8-f32-vcvt/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/common.h> 13 #include <xnnpack/math.h> 14 #include <xnnpack/vcvt.h> 15 16 xnn_qu8_f32_vcvt_ukernel__scalar_x1(size_t n,const uint8_t * x,float * y,const union xnn_qu8_f32_cvt_params params[restrict XNN_MIN_ELEMENTS (1)])17void xnn_qu8_f32_vcvt_ukernel__scalar_x1( 18 size_t n, 19 const uint8_t* x, 20 float* y, 21 const union xnn_qu8_f32_cvt_params params[restrict XNN_MIN_ELEMENTS(1)]) 22 { 23 assert(n != 0); 24 assert(n % sizeof(uint8_t) == 0); 25 assert(x != NULL); 26 assert(y != NULL); 27 28 const int32_t vzero_point = params->scalar.zero_point; 29 const float vscale = params->scalar.scale; 30 31 do { 32 int32_t vx = *x++; 33 vx -= vzero_point; 34 35 float vy = (float) vx; 36 vy *= vscale; 37 *y++ = vy; 38 39 n -= sizeof(uint8_t); 40 } while (n != 0); 41 } 42