1/** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6#include <_mingw_mac.h> 7 8 .file "truncf.S" 9 .text 10 .p2align 4,,15 11 .globl __MINGW_USYMBOL(truncf) 12 .def __MINGW_USYMBOL(truncf); .scl 2; .type 32; .endef 13 14__MINGW_USYMBOL(truncf): 15 vmov r2, r3, d0 16 lsr r3, r3, #20 17 bic r3, r3, #0x800 18 movw r2, #0x7ff 19 cmp r2, r3 /* Check for INF/NAN, just return the input in those cases */ 20 it eq 21 bxeq lr 22 vmrs r1, fpscr 23 orr r0, r1, #0x00c00000 /* Round towards Zero */ 24 vmsr fpscr, r0 25 vcvt.s32.f32 s0, s0 26 vcvt.f32.s32 s0, s0 27 vmsr fpscr, r1 28 bx lr 29