floatundisf.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===-- floatundisf.c - Implement __floatundisf ---------------------------===//
  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. //
  9. // This file implements __floatundisf for the compiler_rt library.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // Returns: convert a to a float, rounding toward even.
  13. // Assumption: float is a IEEE 32 bit floating point type
  14. // du_int is a 64 bit integral type
  15. // seee eeee emmm mmmm mmmm mmmm mmmm mmmm
  16. #include "int_lib.h"
  17. #define SRC_U64
  18. #define DST_SINGLE
  19. #include "int_to_fp_impl.inc"
  20. COMPILER_RT_ABI float __floatundisf(du_int a) { return __floatXiYf__(a); }
  21. #if defined(__ARM_EABI__)
  22. #if defined(COMPILER_RT_ARMHF_TARGET)
  23. AEABI_RTABI float __aeabi_ul2f(du_int a) { return __floatundisf(a); }
  24. #else
  25. COMPILER_RT_ALIAS(__floatundisf, __aeabi_ul2f)
  26. #endif
  27. #endif
  28. #if defined(__MINGW32__) && defined(__arm__)
  29. COMPILER_RT_ALIAS(__floatundisf, __u64tos)
  30. #endif