floattitf.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //===-- lib/floattitf.c - int128 -> quad-precision 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. //
  9. // This file implements ti_int to quad-precision conversion for the
  10. // compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even
  11. // mode.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #define QUAD_PRECISION
  15. #include "fp_lib.h"
  16. #include "int_lib.h"
  17. #if defined(CRT_HAS_TF_MODE)
  18. #define SRC_I128
  19. #define DST_QUAD
  20. #include "int_to_fp_impl.inc"
  21. // Returns: convert a ti_int to a fp_t, rounding toward even.
  22. // Assumption: fp_t is a IEEE 128 bit floating point type
  23. // ti_int is a 128 bit integral type
  24. // seee eeee eeee eeee mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm
  25. // mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
  26. // mmmm mmmm mmmm
  27. COMPILER_RT_ABI fp_t __floattitf(ti_int a) { return __floatXiYf__(a); }
  28. #endif