Stephen Canon | 5c6d2ec | 2010-07-01 17:58:24 +0000 | [diff] [blame] | 1 | //===-- lib/truncdfsf2.c - double -> single conversion ------------*- C -*-===// |
| 2 | // |
Chandler Carruth | 7a739a0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Stephen Canon | 5c6d2ec | 2010-07-01 17:58:24 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
Stephen Canon | 5c6d2ec | 2010-07-01 17:58:24 +0000 | [diff] [blame] | 8 | |
Joerg Sonnenberger | b8e9b02 | 2014-05-29 00:49:57 +0000 | [diff] [blame] | 9 | #define SRC_DOUBLE |
| 10 | #define DST_SINGLE |
| 11 | #include "fp_trunc_impl.inc" |
Stephen Canon | 5c6d2ec | 2010-07-01 17:58:24 +0000 | [diff] [blame] | 12 | |
Joerg Sonnenberger | b8e9b02 | 2014-05-29 00:49:57 +0000 | [diff] [blame] | 13 | COMPILER_RT_ABI float __truncdfsf2(double a) { |
| 14 | return __truncXfYf2__(a); |
Stephen Canon | 5c6d2ec | 2010-07-01 17:58:24 +0000 | [diff] [blame] | 15 | } |
Saleem Abdulrasool | 99e2e66 | 2017-05-16 16:41:37 +0000 | [diff] [blame] | 16 | |
| 17 | #if defined(__ARM_EABI__) |
Eli Friedman | 83774b4 | 2017-10-03 21:25:07 +0000 | [diff] [blame] | 18 | #if defined(COMPILER_RT_ARMHF_TARGET) |
Saleem Abdulrasool | 99e2e66 | 2017-05-16 16:41:37 +0000 | [diff] [blame] | 19 | AEABI_RTABI float __aeabi_d2f(double a) { |
| 20 | return __truncdfsf2(a); |
| 21 | } |
Eli Friedman | 83774b4 | 2017-10-03 21:25:07 +0000 | [diff] [blame] | 22 | #else |
| 23 | AEABI_RTABI float __aeabi_d2f(double a) COMPILER_RT_ALIAS(__truncdfsf2); |
Saleem Abdulrasool | 99e2e66 | 2017-05-16 16:41:37 +0000 | [diff] [blame] | 24 | #endif |
Eli Friedman | 83774b4 | 2017-10-03 21:25:07 +0000 | [diff] [blame] | 25 | #endif |