truncsfhf2.c 931 B

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