fixunssfsivfp.S revision 276851
11638Srgrimes//===-- fixunssfsivfp.S - Implement fixunssfsivfp -------------------------===//
21638Srgrimes//
31638Srgrimes//                     The LLVM Compiler Infrastructure
41638Srgrimes//
51638Srgrimes// This file is dual licensed under the MIT and the University of Illinois Open
61638Srgrimes// Source Licenses. See LICENSE.TXT for details.
71638Srgrimes//
81638Srgrimes//===----------------------------------------------------------------------===//
91638Srgrimes
101638Srgrimes#include "../assembly.h"
111638Srgrimes
121638Srgrimes//
131638Srgrimes// extern unsigned int __fixunssfsivfp(float a);
141638Srgrimes//
151638Srgrimes// Converts single precision float to a 32-bit unsigned int rounding towards
161638Srgrimes// zero. All negative values become zero.
171638Srgrimes// Uses Darwin calling convention where a single precision parameter is
181638Srgrimes// passed in a GPR..
191638Srgrimes//
201638Srgrimes	.syntax unified
211638Srgrimes	.p2align 2
221638SrgrimesDEFINE_COMPILERRT_FUNCTION(__fixunssfsivfp)
231638Srgrimes	vmov	s15, r0        // load float register from R0
241638Srgrimes	vcvt.u32.f32 s15, s15  // convert single to 32-bit unsigned into s15
251638Srgrimes	vmov	r0, s15	       // move s15 to result register
261638Srgrimes	bx	lr
271638SrgrimesEND_COMPILERRT_FUNCTION(__fixunssfsivfp)
281638Srgrimes