xref: /openbsd-src/gnu/llvm/compiler-rt/lib/builtins/extendhfsf2.c (revision d89ec533011f513df1010f142a111086a0785f09)
13cab2bb3Spatrick //===-- lib/extendhfsf2.c - half -> single conversion -------------*- C -*-===//
23cab2bb3Spatrick //
33cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
43cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information.
53cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
63cab2bb3Spatrick //
73cab2bb3Spatrick //===----------------------------------------------------------------------===//
83cab2bb3Spatrick 
93cab2bb3Spatrick #define SRC_HALF
103cab2bb3Spatrick #define DST_SINGLE
113cab2bb3Spatrick #include "fp_extend_impl.inc"
123cab2bb3Spatrick 
133cab2bb3Spatrick // Use a forwarding definition and noinline to implement a poor man's alias,
143cab2bb3Spatrick // as there isn't a good cross-platform way of defining one.
__extendhfsf2(src_t a)15*d89ec533Spatrick COMPILER_RT_ABI NOINLINE float __extendhfsf2(src_t a) {
163cab2bb3Spatrick   return __extendXfYf2__(a);
173cab2bb3Spatrick }
183cab2bb3Spatrick 
__gnu_h2f_ieee(src_t a)19*d89ec533Spatrick COMPILER_RT_ABI float __gnu_h2f_ieee(src_t a) { return __extendhfsf2(a); }
203cab2bb3Spatrick 
213cab2bb3Spatrick #if defined(__ARM_EABI__)
223cab2bb3Spatrick #if defined(COMPILER_RT_ARMHF_TARGET)
__aeabi_h2f(src_t a)23*d89ec533Spatrick AEABI_RTABI float __aeabi_h2f(src_t a) { return __extendhfsf2(a); }
243cab2bb3Spatrick #else
253cab2bb3Spatrick COMPILER_RT_ALIAS(__extendhfsf2, __aeabi_h2f)
263cab2bb3Spatrick #endif
273cab2bb3Spatrick #endif
28