1156cd587Sjoerg//===-- fixdfsivfp.S - Implement fixdfsivfp -----------------------===// 2156cd587Sjoerg// 3156cd587Sjoerg// The LLVM Compiler Infrastructure 4156cd587Sjoerg// 5156cd587Sjoerg// This file is dual licensed under the MIT and the University of Illinois Open 6156cd587Sjoerg// Source Licenses. See LICENSE.TXT for details. 7156cd587Sjoerg// 8156cd587Sjoerg//===----------------------------------------------------------------------===// 9156cd587Sjoerg 10156cd587Sjoerg#include "../assembly.h" 11156cd587Sjoerg 12156cd587Sjoerg// 13156cd587Sjoerg// extern int __fixdfsivfp(double a); 14156cd587Sjoerg// 15156cd587Sjoerg// Converts double precision float to a 32-bit int rounding towards zero. 16156cd587Sjoerg// Uses Darwin calling convention where a double precision parameter is 17156cd587Sjoerg// passed in GPR register pair. 18156cd587Sjoerg// 19156cd587Sjoerg .syntax unified 20*61f2f256Sjoerg .p2align 2 21156cd587SjoergDEFINE_COMPILERRT_FUNCTION(__fixdfsivfp) 22156cd587Sjoerg vmov d7, r0, r1 // load double register from R0/R1 23156cd587Sjoerg vcvt.s32.f64 s15, d7 // convert double to 32-bit int into s15 24156cd587Sjoerg vmov r0, s15 // move s15 to result register 25156cd587Sjoerg bx lr 26156cd587SjoergEND_COMPILERRT_FUNCTION(__fixdfsivfp) 27