fixunsdfsivfp.S revision 236011
11556Srgrimes//===-- fixunsdfsivfp.S - Implement fixunsdfsivfp -------------------------===//
21556Srgrimes//
31556Srgrimes//                     The LLVM Compiler Infrastructure
41556Srgrimes//
51556Srgrimes// This file is dual licensed under the MIT and the University of Illinois Open
61556Srgrimes// Source Licenses. See LICENSE.TXT for details.
71556Srgrimes//
81556Srgrimes//===----------------------------------------------------------------------===//
91556Srgrimes
101556Srgrimes#include "../assembly.h"
111556Srgrimes
121556Srgrimes//
131556Srgrimes// extern unsigned int __fixunsdfsivfp(double a);
141556Srgrimes//
151556Srgrimes// Converts double precision float to a 32-bit unsigned int rounding towards
161556Srgrimes// zero. All negative values become zero.
171556Srgrimes// Uses Darwin calling convention where a double precision parameter is
181556Srgrimes// passed in GPR register pair.
191556Srgrimes//
201556Srgrimes	.syntax unified
211556Srgrimes	.align 2
221556SrgrimesDEFINE_COMPILERRT_FUNCTION(__fixunsdfsivfp)
231556Srgrimes	vmov	d7, r0, r1    // load double register from R0/R1
241556Srgrimes	vcvt.u32.f64 s15, d7  // convert double to 32-bit int into s15
251556Srgrimes	vmov	r0, s15	      // move s15 to result register
261556Srgrimes	bx	lr
271556Srgrimes