Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/arm/fixunssfsivfp.S
35292 views
//===-- fixunssfsivfp.S - Implement fixunssfsivfp -------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "../assembly.h"910//11// extern unsigned int __fixunssfsivfp(float a);12//13// Converts single precision float to a 32-bit unsigned int rounding towards14// zero. All negative values become zero.15// Uses Darwin calling convention where a single precision parameter is16// passed in a GPR..17//18.syntax unified19.p2align 220DEFINE_COMPILERRT_FUNCTION(__fixunssfsivfp)21#if defined(COMPILER_RT_ARMHF_TARGET)22vcvt.u32.f32 s0, s023vmov r0, s024#else25vmov s15, r0 // load float register from R026vcvt.u32.f32 s15, s15 // convert single to 32-bit unsigned into s1527vmov r0, s15 // move s15 to result register28#endif29bx lr30END_COMPILERRT_FUNCTION(__fixunssfsivfp)3132NO_EXEC_STACK_DIRECTIVE33343536