Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/arm/fixunsdfsivfp.S
35291 views
//===-- fixunsdfsivfp.S - Implement fixunsdfsivfp -------------------------===//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 __fixunsdfsivfp(double a);12//13// Converts double precision float to a 32-bit unsigned int rounding towards14// zero. All negative values become zero.15// Uses Darwin calling convention where a double precision parameter is16// passed in GPR register pair.17//18.syntax unified19.p2align 220DEFINE_COMPILERRT_FUNCTION(__fixunsdfsivfp)21#if defined(COMPILER_RT_ARMHF_TARGET)22vcvt.u32.f64 s0, d023vmov r0, s024#else25vmov d7, r0, r1 // load double register from R0/R126vcvt.u32.f64 s15, d7 // convert double to 32-bit int into s1527vmov r0, s15 // move s15 to result register28#endif29bx lr30END_COMPILERRT_FUNCTION(__fixunsdfsivfp)3132NO_EXEC_STACK_DIRECTIVE33343536