36 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8//9// This file implements ti_int to quad-precision conversion for the10// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even11// mode.12//13//===----------------------------------------------------------------------===//14 15#define QUAD_PRECISION16#include "fp_lib.h"17#include "int_lib.h"18 19#if defined(CRT_HAS_TF_MODE)20#define SRC_I12821#define DST_QUAD22#include "int_to_fp_impl.inc"23 24// Returns: convert a ti_int to a fp_t, rounding toward even.25 26// Assumption: fp_t is a IEEE 128 bit floating point type27// ti_int is a 128 bit integral type28 29// seee eeee eeee eeee mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm30// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm31// mmmm mmmm mmmm32 33COMPILER_RT_ABI fp_t __floattitf(ti_int a) { return __floatXiYf__(a); }34 35#endif36