1 // Copyright 2020 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 #include <math.h> 8 #include <stddef.h> 9 10 #include <xnnpack/common.h> 11 #include <xnnpack/math-stubs.h> 12 13 xnn_math_f32_roundz__scalar_trunc(size_t n,const float * input,float * output)14void xnn_math_f32_roundz__scalar_trunc( 15 size_t n, 16 const float* input, 17 float* output) 18 { 19 assert(n % sizeof(float) == 0); 20 21 for (; n != 0; n -= sizeof(float)) { 22 const float vx = *input++; 23 24 const float vy = truncf(vx); 25 26 *output++ = vy; 27 } 28 } 29