fixdfsivfp.S revision 225736
1263509Sdim//===-- fixdfsivfp.S - Implement fixdfsivfp -----------------------===//
2218885Sdim//
3218885Sdim//                     The LLVM Compiler Infrastructure
4218885Sdim//
5218885Sdim// This file is dual licensed under the MIT and the University of Illinois Open
6218885Sdim// Source Licenses. See LICENSE.TXT for details.
7218885Sdim//
8218885Sdim//===----------------------------------------------------------------------===//
9218885Sdim
10263509Sdim#include "../assembly.h"
11218885Sdim
12218885Sdim//
13218885Sdim// extern int __fixdfsivfp(double a);
14218885Sdim//
15218885Sdim// Converts double precision float to a 32-bit int rounding towards zero.
16218885Sdim// Uses Darwin calling convention where a double precision parameter is
17218885Sdim// passed in GPR register pair.
18218885Sdim//
19218885Sdim	.align 2
20263509SdimDEFINE_COMPILERRT_FUNCTION(__fixdfsivfp)
21263509Sdim	fmdrr	d7, r0, r1    // load double register from R0/R1
22263509Sdim	ftosizd	s15, d7       // convert double to 32-bit int into s15
23218885Sdim	fmrs	r0, s15	      // move s15 to result register
24218885Sdim	bx	lr
25218885Sdim