1 //===-- lib/truncsfhf2.c - single -> half conversion --------------*- C -*-===// 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 10 #define SRC_SINGLE 11 #define DST_HALF 12 #include "fp_trunc_impl.inc" 13 14 // Use a forwarding definition and noinline to implement a poor man's alias, 15 // as there isn't a good cross-platform way of defining one. __truncsfhf2(float a)16COMPILER_RT_ABI NOINLINE uint16_t __truncsfhf2(float a) { 17 return __truncXfYf2__(a); 18 } 19 __gnu_f2h_ieee(float a)20COMPILER_RT_ABI uint16_t __gnu_f2h_ieee(float a) { 21 return __truncsfhf2(a); 22 } 23 24 #if defined(__ARM_EABI__) 25 #if defined(COMPILER_RT_ARMHF_TARGET) __aeabi_f2h(float a)26AEABI_RTABI uint16_t __aeabi_f2h(float a) { 27 return __truncsfhf2(a); 28 } 29 #else 30 AEABI_RTABI uint16_t __aeabi_f2h(float a) COMPILER_RT_ALIAS(__truncsfhf2); 31 #endif 32 #endif 33