Home | History | Annotate | Line # | Download | only in arm
      1      1.1  joerg //===-- fixunssfsivfp.S - Implement fixunssfsivfp -------------------------===//
      2      1.1  joerg //
      3      1.1  joerg //                     The LLVM Compiler Infrastructure
      4      1.1  joerg //
      5      1.1  joerg // This file is dual licensed under the MIT and the University of Illinois Open
      6      1.1  joerg // Source Licenses. See LICENSE.TXT for details.
      7      1.1  joerg //
      8      1.1  joerg //===----------------------------------------------------------------------===//
      9      1.1  joerg 
     10      1.1  joerg #include "../assembly.h"
     11      1.1  joerg 
     12      1.1  joerg //
     13      1.1  joerg // extern unsigned int __fixunssfsivfp(float a);
     14      1.1  joerg //
     15      1.1  joerg // Converts single precision float to a 32-bit unsigned int rounding towards
     16      1.1  joerg // zero. All negative values become zero.
     17      1.1  joerg // Uses Darwin calling convention where a single precision parameter is
     18      1.1  joerg // passed in a GPR..
     19      1.1  joerg //
     20      1.1  joerg 	.syntax unified
     21  1.1.1.2  joerg 	.p2align 2
     22      1.1  joerg DEFINE_COMPILERRT_FUNCTION(__fixunssfsivfp)
     23      1.1  joerg 	vmov	s15, r0        // load float register from R0
     24      1.1  joerg 	vcvt.u32.f32 s15, s15  // convert single to 32-bit unsigned into s15
     25      1.1  joerg 	vmov	r0, s15	       // move s15 to result register
     26      1.1  joerg 	bx	lr
     27      1.1  joerg END_COMPILERRT_FUNCTION(__fixunssfsivfp)
     28