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