Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/arm/fixsfsivfp.S
35292 views
//===-- fixsfsivfp.S - Implement fixsfsivfp -----------------------===//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 int __fixsfsivfp(float a);12//13// Converts single precision float to a 32-bit int rounding towards zero.14// Uses Darwin calling convention where a single precision parameter is15// passed in a GPR..16//17.syntax unified18.p2align 219DEFINE_COMPILERRT_FUNCTION(__fixsfsivfp)20#if defined(COMPILER_RT_ARMHF_TARGET)21vcvt.s32.f32 s0, s022vmov r0, s023#else24vmov s15, r0 // load float register from R025vcvt.s32.f32 s15, s15 // convert single to 32-bit int into s1526vmov r0, s15 // move s15 to result register27#endif28bx lr29END_COMPILERRT_FUNCTION(__fixsfsivfp)3031NO_EXEC_STACK_DIRECTIVE32333435