blob: e94e5f3dcd6809f95a94540062e5893d24112f49 [file] [log] [blame]
Joerg Sonnenberger91bd6982015-03-11 21:13:56 +00001/* ===-- fixsfsi.c - Implement __fixsfsi -----------------------------------===
2 *
3 * The LLVM Compiler Infrastructure
4 *
5 * This file is dual licensed under the MIT and the University of Illinois Open
6 * Source Licenses. See LICENSE.TXT for details.
7 *
8 * ===----------------------------------------------------------------------===
9 */
Stephen Canon4be0d7e2010-07-02 22:10:58 +000010
11#define SINGLE_PRECISION
12#include "fp_lib.h"
Joerg Sonnenberger91bd6982015-03-11 21:13:56 +000013typedef si_int fixint_t;
14typedef su_int fixuint_t;
15#include "fp_fixint_impl.inc"
Stephen Canon4be0d7e2010-07-02 22:10:58 +000016
Joerg Sonnenberger91bd6982015-03-11 21:13:56 +000017COMPILER_RT_ABI si_int
Anton Korobeynikove63da932011-04-19 17:52:09 +000018__fixsfsi(fp_t a) {
Joerg Sonnenberger91bd6982015-03-11 21:13:56 +000019 return __fixint(a);
Stephen Canon4be0d7e2010-07-02 22:10:58 +000020}
Saleem Abdulrasool36ac5dd2017-05-16 16:41:37 +000021
22#if defined(__ARM_EABI__)
Eli Friedman0d586d02017-10-03 21:25:07 +000023#if defined(COMPILER_RT_ARMHF_TARGET)
Saleem Abdulrasool36ac5dd2017-05-16 16:41:37 +000024AEABI_RTABI si_int __aeabi_f2iz(fp_t a) {
25 return __fixsfsi(a);
26}
Eli Friedman0d586d02017-10-03 21:25:07 +000027#else
28AEABI_RTABI si_int __aeabi_f2iz(fp_t a) COMPILER_RT_ALIAS(__fixsfsi);
Saleem Abdulrasool36ac5dd2017-05-16 16:41:37 +000029#endif
Eli Friedman0d586d02017-10-03 21:25:07 +000030#endif