fixunsdfsivfp.S revision 214152
150477Speter//===-- fixunsdfsivfp.S - Implement fixunsdfsivfp -------------------------===// 21541Srgrimes// 31541Srgrimes// The LLVM Compiler Infrastructure 41541Srgrimes// 51541Srgrimes// This file is distributed under the University of Illinois Open Source 61541Srgrimes// License. See LICENSE.TXT for details. 71541Srgrimes// 81541Srgrimes//===----------------------------------------------------------------------===// 91541Srgrimes 101541Srgrimes#include "../assembly.h" 111541Srgrimes 121541Srgrimes// 131541Srgrimes// extern unsigned int __fixunsdfsivfp(double a); 141541Srgrimes// 151541Srgrimes// Converts double precision float to a 32-bit unsigned int rounding towards 161541Srgrimes// zero. All negative values become zero. 171541Srgrimes// Uses Darwin calling convention where a double precision parameter is 181541Srgrimes// passed in GPR register pair. 191541Srgrimes// 201541Srgrimes .align 2 211541SrgrimesDEFINE_COMPILERRT_FUNCTION(__fixunsdfsivfp) 221541Srgrimes fmdrr d7, r0, r1 // load double register from R0/R1 231541Srgrimes ftouizd s15, d7 // convert double to 32-bit int into s15 241541Srgrimes fmrs r0, s15 // move s15 to result register 251541Srgrimes bx lr 261541Srgrimes