1 1.1 joerg //===-- fixdfsivfp.S - Implement fixdfsivfp -----------------------===// 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 int __fixdfsivfp(double a); 14 1.1 joerg // 15 1.1 joerg // Converts double precision float to a 32-bit int rounding towards zero. 16 1.1 joerg // Uses Darwin calling convention where a double precision parameter is 17 1.1 joerg // passed in GPR register pair. 18 1.1 joerg // 19 1.1 joerg .syntax unified 20 1.1.1.2 joerg .p2align 2 21 1.1 joerg DEFINE_COMPILERRT_FUNCTION(__fixdfsivfp) 22 1.1 joerg vmov d7, r0, r1 // load double register from R0/R1 23 1.1 joerg vcvt.s32.f64 s15, d7 // convert double to 32-bit int into s15 24 1.1 joerg vmov r0, s15 // move s15 to result register 25 1.1 joerg bx lr 26 1.1 joerg END_COMPILERRT_FUNCTION(__fixdfsivfp) 27