10963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//===-- floatunssisfvfp.S - Implement floatunssisfvfp ---------------------===//
20963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//
30963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//                     The LLVM Compiler Infrastructure
40963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//
59ad441ffec97db647fee3725b3424284fb913e14Howard Hinnant// This file is dual licensed under the MIT and the University of Illinois Open
69ad441ffec97db647fee3725b3424284fb913e14Howard Hinnant// Source Licenses. See LICENSE.TXT for details.
70963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//
80963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//===----------------------------------------------------------------------===//
90963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik
1019336a2d6b9b375ac106125950f4ff09742d1aecDaniel Dunbar#include "../assembly.h"
110963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik
120963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//
130963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik// extern float __floatunssisfvfp(unsigned int a);
140963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//
150963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik// Converts single precision float to a 32-bit int rounding towards zero.
160963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik// Uses Darwin calling convention where a single precision result is
170963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik// return in a GPR..
180963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik//
19c20f862690410045fc8c77879f7e78918d2372e4Bob Wilson	.syntax unified
202d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines	.p2align 2
21b4b1e8c5085cf83a50242057775a33ae4323d402Daniel DunbarDEFINE_COMPILERRT_FUNCTION(__floatunssisfvfp)
22c20f862690410045fc8c77879f7e78918d2372e4Bob Wilson	vmov	s15, r0	       // move int to float register s15
23c20f862690410045fc8c77879f7e78918d2372e4Bob Wilson	vcvt.f32.u32 s15, s15  // convert 32-bit int in s15 to float in s15
24c20f862690410045fc8c77879f7e78918d2372e4Bob Wilson	vmov	r0, s15        // move s15 to result register
250963c9e8ea7f97732b0fce419fa6f2e96d951969Nick Kledzik	bx	lr
262d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen HinesEND_COMPILERRT_FUNCTION(__floatunssisfvfp)
27c58a43648cd6121c51a2e795a28e2ef90d7813e6Pirama Arumuga Nainar
28c58a43648cd6121c51a2e795a28e2ef90d7813e6Pirama Arumuga NainarNO_EXEC_STACK_DIRECTIVE
29c58a43648cd6121c51a2e795a28e2ef90d7813e6Pirama Arumuga Nainar
30