Edward O'Callaghan | 4856eef | 2009-08-05 04:02:56 +0000 | [diff] [blame] | 1 | /* ===-- fixunssfsi.c - Implement __fixunssfsi -----------------------------=== |
| 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
Howard Hinnant | 5b791f6 | 2010-11-16 22:13:33 +0000 | [diff] [blame] | 5 | * This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | * Source Licenses. See LICENSE.TXT for details. |
Edward O'Callaghan | 4856eef | 2009-08-05 04:02:56 +0000 | [diff] [blame] | 7 | * |
| 8 | * ===----------------------------------------------------------------------=== |
| 9 | * |
| 10 | * This file implements __fixunssfsi for the compiler_rt library. |
| 11 | * |
| 12 | * ===----------------------------------------------------------------------=== |
| 13 | */ |
Daniel Dunbar | fd08999 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 14 | |
Joerg Sonnenberger | 91bd698 | 2015-03-11 21:13:56 +0000 | [diff] [blame] | 15 | #define SINGLE_PRECISION |
| 16 | #include "fp_lib.h" |
| 17 | typedef su_int fixuint_t; |
| 18 | #include "fp_fixuint_impl.inc" |
Daniel Dunbar | fd08999 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 19 | |
Anton Korobeynikov | e63da93 | 2011-04-19 17:52:09 +0000 | [diff] [blame] | 20 | COMPILER_RT_ABI su_int |
Joerg Sonnenberger | 91bd698 | 2015-03-11 21:13:56 +0000 | [diff] [blame] | 21 | __fixunssfsi(fp_t a) { |
| 22 | return __fixuint(a); |
Daniel Dunbar | fd08999 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 23 | } |
Saleem Abdulrasool | 36ac5dd | 2017-05-16 16:41:37 +0000 | [diff] [blame] | 24 | |
| 25 | #if defined(__ARM_EABI__) |
Eli Friedman | 0d586d0 | 2017-10-03 21:25:07 +0000 | [diff] [blame] | 26 | #if defined(COMPILER_RT_ARMHF_TARGET) |
Saleem Abdulrasool | 36ac5dd | 2017-05-16 16:41:37 +0000 | [diff] [blame] | 27 | AEABI_RTABI su_int __aeabi_f2uiz(fp_t a) { |
| 28 | return __fixunssfsi(a); |
| 29 | } |
Eli Friedman | 0d586d0 | 2017-10-03 21:25:07 +0000 | [diff] [blame] | 30 | #else |
| 31 | AEABI_RTABI su_int __aeabi_f2uiz(fp_t a) COMPILER_RT_ALIAS(__fixunssfsi); |
Saleem Abdulrasool | 36ac5dd | 2017-05-16 16:41:37 +0000 | [diff] [blame] | 32 | #endif |
Eli Friedman | 0d586d0 | 2017-10-03 21:25:07 +0000 | [diff] [blame] | 33 | #endif |