1*0b57cec5SDimitry Andric //===-- lib/truncdfhf2.c - double -> half conversion --------------*- C -*-===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric 9*0b57cec5SDimitry Andric #define SRC_DOUBLE 10*0b57cec5SDimitry Andric #define DST_HALF 11*0b57cec5SDimitry Andric #include "fp_trunc_impl.inc" 12*0b57cec5SDimitry Andric 13*0b57cec5SDimitry Andric COMPILER_RT_ABI uint16_t __truncdfhf2(double a) { return __truncXfYf2__(a); } 14*0b57cec5SDimitry Andric 15*0b57cec5SDimitry Andric #if defined(__ARM_EABI__) 16*0b57cec5SDimitry Andric #if defined(COMPILER_RT_ARMHF_TARGET) 17*0b57cec5SDimitry Andric AEABI_RTABI uint16_t __aeabi_d2h(double a) { return __truncdfhf2(a); } 18*0b57cec5SDimitry Andric #else 19*0b57cec5SDimitry Andric COMPILER_RT_ALIAS(__truncdfhf2, __aeabi_d2h) 20*0b57cec5SDimitry Andric #endif 21*0b57cec5SDimitry Andric #endif 22