2019-04-28 22:47:49 +00:00
|
|
|
//===-- floatundisf.c - Implement __floatundisf ---------------------------===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements __floatundisf for the compiler_rt library.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-06-26 16:47:03 +00:00
|
|
|
|
2019-04-28 22:47:49 +00:00
|
|
|
// Returns: convert a to a float, rounding toward even.
|
2009-06-26 16:47:03 +00:00
|
|
|
|
2019-04-28 22:47:49 +00:00
|
|
|
// Assumption: float is a IEEE 32 bit floating point type
|
|
|
|
// du_int is a 64 bit integral type
|
2009-06-26 16:47:03 +00:00
|
|
|
|
2019-04-28 22:47:49 +00:00
|
|
|
// seee eeee emmm mmmm mmmm mmmm mmmm mmmm
|
2009-06-26 16:47:03 +00:00
|
|
|
|
2011-04-19 17:51:24 +00:00
|
|
|
#include "int_lib.h"
|
|
|
|
|
2023-10-18 14:13:43 +01:00
|
|
|
#define SRC_U64
|
|
|
|
#define DST_SINGLE
|
|
|
|
#include "int_to_fp_impl.inc"
|
|
|
|
|
|
|
|
COMPILER_RT_ABI float __floatundisf(du_int a) { return __floatXiYf__(a); }
|
2017-05-16 16:41:37 +00:00
|
|
|
|
|
|
|
#if defined(__ARM_EABI__)
|
2017-10-03 21:25:07 +00:00
|
|
|
#if defined(COMPILER_RT_ARMHF_TARGET)
|
2019-04-28 21:53:32 +00:00
|
|
|
AEABI_RTABI float __aeabi_ul2f(du_int a) { return __floatundisf(a); }
|
2017-10-03 21:25:07 +00:00
|
|
|
#else
|
2019-04-29 00:46:23 +00:00
|
|
|
COMPILER_RT_ALIAS(__floatundisf, __aeabi_ul2f)
|
2017-10-03 21:25:07 +00:00
|
|
|
#endif
|
2017-05-16 16:41:37 +00:00
|
|
|
#endif
|
2021-08-10 13:27:08 +03:00
|
|
|
|
|
|
|
#if defined(__MINGW32__) && defined(__arm__)
|
|
|
|
COMPILER_RT_ALIAS(__floatundisf, __u64tos)
|
|
|
|
#endif
|