xref: /netbsd-src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/floatunssisfvfp.S (revision 61f2f2562dcc3e4eb50e7ec5dab0dfa1f093861a)
1156cd587Sjoerg//===-- floatunssisfvfp.S - Implement floatunssisfvfp ---------------------===//
2156cd587Sjoerg//
3156cd587Sjoerg//                     The LLVM Compiler Infrastructure
4156cd587Sjoerg//
5156cd587Sjoerg// This file is dual licensed under the MIT and the University of Illinois Open
6156cd587Sjoerg// Source Licenses. See LICENSE.TXT for details.
7156cd587Sjoerg//
8156cd587Sjoerg//===----------------------------------------------------------------------===//
9156cd587Sjoerg
10156cd587Sjoerg#include "../assembly.h"
11156cd587Sjoerg
12156cd587Sjoerg//
13156cd587Sjoerg// extern float __floatunssisfvfp(unsigned int a);
14156cd587Sjoerg//
15156cd587Sjoerg// Converts single precision float to a 32-bit int rounding towards zero.
16156cd587Sjoerg// Uses Darwin calling convention where a single precision result is
17156cd587Sjoerg// return in a GPR..
18156cd587Sjoerg//
19156cd587Sjoerg	.syntax unified
20*61f2f256Sjoerg	.p2align 2
21156cd587SjoergDEFINE_COMPILERRT_FUNCTION(__floatunssisfvfp)
22156cd587Sjoerg	vmov	s15, r0	       // move int to float register s15
23156cd587Sjoerg	vcvt.f32.u32 s15, s15  // convert 32-bit int in s15 to float in s15
24156cd587Sjoerg	vmov	r0, s15        // move s15 to result register
25156cd587Sjoerg	bx	lr
26156cd587SjoergEND_COMPILERRT_FUNCTION(__floatunssisfvfp)
27