fixsfsivfp.S revision 214152
1214152Sed//===-- fixsfsivfp.S - Implement fixsfsivfp -----------------------===//
2214152Sed//
3214152Sed//                     The LLVM Compiler Infrastructure
4214152Sed//
5214152Sed// This file is distributed under the University of Illinois Open Source
6214152Sed// License. See LICENSE.TXT for details.
7214152Sed//
8214152Sed//===----------------------------------------------------------------------===//
9214152Sed
10214152Sed#include "../assembly.h"
11214152Sed
12214152Sed//
13214152Sed// extern int __fixsfsivfp(float a);
14214152Sed//
15214152Sed// Converts single precision float to a 32-bit int rounding towards zero.
16214152Sed// Uses Darwin calling convention where a single precision parameter is
17214152Sed// passed in a GPR..
18214152Sed//
19214152Sed	.align 2
20214152SedDEFINE_COMPILERRT_FUNCTION(__fixsfsivfp)
21214152Sed	fmsr	s15, r0      // load float register from R0
22214152Sed	ftosizs	s15, s15     // convert single to 32-bit int into s15
23214152Sed	fmrs	r0, s15	     // move s15 to result register
24214152Sed	bx	lr
25