blob: 5b9588175717c7439f29cc0a9067ab49d958d126 [file] [log] [blame]
Joerg Sonnenberger91bd6982015-03-11 21:13:56 +00001/* ===-- fixdfsi.c - Implement __fixdfsi -----------------------------------===
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 DOUBLE_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"
Anton Korobeynikov75e3c192011-04-19 17:51:24 +000016
Joerg Sonnenberger91bd6982015-03-11 21:13:56 +000017COMPILER_RT_ABI si_int
Joerg Sonnenberger6e99daa2014-03-01 15:30:50 +000018__fixdfsi(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_d2iz(fp_t a) {
25 return __fixdfsi(a);
26}
Eli Friedman0d586d02017-10-03 21:25:07 +000027#else
28AEABI_RTABI si_int __aeabi_d2iz(fp_t a) COMPILER_RT_ALIAS(__fixdfsi);
Saleem Abdulrasool36ac5dd2017-05-16 16:41:37 +000029#endif
Eli Friedman0d586d02017-10-03 21:25:07 +000030#endif