floatsisfvfp.S revision 276851
1166124Srafan//===-- floatsisfvfp.S - Implement floatsisfvfp ---------------------------===// 2166124Srafan// 3166124Srafan// The LLVM Compiler Infrastructure 4166124Srafan// 5166124Srafan// This file is dual licensed under the MIT and the University of Illinois Open 6166124Srafan// Source Licenses. See LICENSE.TXT for details. 7166124Srafan// 8166124Srafan//===----------------------------------------------------------------------===// 9166124Srafan 10166124Srafan#include "../assembly.h" 11166124Srafan 12166124Srafan// 13166124Srafan// extern float __floatsisfvfp(int a); 14166124Srafan// 15166124Srafan// Converts single precision float to a 32-bit int rounding towards zero. 16166124Srafan// Uses Darwin calling convention where a single precision result is 17166124Srafan// return in a GPR.. 18166124Srafan// 19166124Srafan .syntax unified 20166124Srafan .p2align 2 21166124SrafanDEFINE_COMPILERRT_FUNCTION(__floatsisfvfp) 22166124Srafan vmov s15, r0 // move int to float register s15 23166124Srafan vcvt.f32.s32 s15, s15 // convert 32-bit int in s15 to float in s15 24166124Srafan vmov r0, s15 // move s15 to result register 25166124Srafan bx lr 26166124SrafanEND_COMPILERRT_FUNCTION(__floatsisfvfp) 27166124Srafan