mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-31 17:52:27 +00:00
parent
6b10f4d0b6
commit
b5fcb59a85
11 changed files with 209 additions and 178 deletions
17
third_party/compiler_rt/extendhfdf2.c
vendored
17
third_party/compiler_rt/extendhfdf2.c
vendored
|
@ -1,17 +0,0 @@
|
|||
//===-- lib/extendhfdf2.c - half -> dubble conversion -------------*- C -*-===//
|
||||
//
|
||||
// The Cosmopolitan Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
#define SRC_HALF
|
||||
#define DST_DOUBLE
|
||||
#include "third_party/compiler_rt/fp16_extend_impl.inc"
|
||||
|
||||
COMPILER_RT_ABI dst_t __extendhfdf2(src_t a) {
|
||||
return __extendXfYf2__(a);
|
||||
}
|
27
third_party/compiler_rt/extendhfsf2.c
vendored
27
third_party/compiler_rt/extendhfsf2.c
vendored
|
@ -1,27 +0,0 @@
|
|||
//===-- lib/extendhfsf2.c - half -> single conversion -------------*- C -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define SRC_HALF
|
||||
#define DST_SINGLE
|
||||
#include "fp16_extend_impl.inc"
|
||||
|
||||
// Use a forwarding definition and noinline to implement a poor man's alias,
|
||||
// as there isn't a good cross-platform way of defining one.
|
||||
COMPILER_RT_ABI NOINLINE float __extendhfsf2(src_t a) {
|
||||
return __extendXfYf2__(a);
|
||||
}
|
||||
|
||||
COMPILER_RT_ABI float __gnu_h2f_ieee(src_t a) { return __extendhfsf2(a); }
|
||||
|
||||
#if defined(__ARM_EABI__)
|
||||
#if defined(COMPILER_RT_ARMHF_TARGET)
|
||||
AEABI_RTABI float __aeabi_h2f(src_t a) { return __extendhfsf2(a); }
|
||||
#else
|
||||
COMPILER_RT_ALIAS(__extendhfsf2, __aeabi_h2f)
|
||||
#endif
|
||||
#endif
|
25
third_party/compiler_rt/extendsftf2.c
vendored
25
third_party/compiler_rt/extendsftf2.c
vendored
|
@ -1,25 +0,0 @@
|
|||
//===-- lib/extendsftf2.c - single -> quad conversion -------------*- C -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
__static_yoink("huge_compiler_rt_license");
|
||||
|
||||
#define QUAD_PRECISION
|
||||
#include "third_party/compiler_rt/fp_lib.inc"
|
||||
|
||||
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
|
||||
#define SRC_SINGLE
|
||||
#define DST_QUAD
|
||||
#include "third_party/compiler_rt/fp_extend_impl.inc"
|
||||
|
||||
COMPILER_RT_ABI long double __extendsftf2(float a) {
|
||||
return __extendXfYf2__(a);
|
||||
}
|
||||
|
||||
#endif
|
21
third_party/compiler_rt/truncdfhf2.c
vendored
21
third_party/compiler_rt/truncdfhf2.c
vendored
|
@ -1,21 +0,0 @@
|
|||
//===-- lib/truncdfhf2.c - double -> half conversion --------------*- C -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define SRC_DOUBLE
|
||||
#define DST_HALF
|
||||
#include "fp16_trunc_impl.inc"
|
||||
|
||||
COMPILER_RT_ABI dst_t __truncdfhf2(double a) { return __truncXfYf2__(a); }
|
||||
|
||||
#if defined(__ARM_EABI__)
|
||||
#if defined(COMPILER_RT_ARMHF_TARGET)
|
||||
AEABI_RTABI dst_t __aeabi_d2h(double a) { return __truncdfhf2(a); }
|
||||
#else
|
||||
COMPILER_RT_ALIAS(__truncdfhf2, __aeabi_d2h)
|
||||
#endif
|
||||
#endif
|
27
third_party/compiler_rt/truncsfhf2.c
vendored
27
third_party/compiler_rt/truncsfhf2.c
vendored
|
@ -1,27 +0,0 @@
|
|||
//===-- lib/truncsfhf2.c - single -> half conversion --------------*- C -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define SRC_SINGLE
|
||||
#define DST_HALF
|
||||
#include "fp16_trunc_impl.inc"
|
||||
|
||||
// Use a forwarding definition and noinline to implement a poor man's alias,
|
||||
// as there isn't a good cross-platform way of defining one.
|
||||
COMPILER_RT_ABI NOINLINE dst_t __truncsfhf2(float a) {
|
||||
return __truncXfYf2__(a);
|
||||
}
|
||||
|
||||
COMPILER_RT_ABI dst_t __gnu_f2h_ieee(float a) { return __truncsfhf2(a); }
|
||||
|
||||
#if defined(__ARM_EABI__)
|
||||
#if defined(COMPILER_RT_ARMHF_TARGET)
|
||||
AEABI_RTABI dst_t __aeabi_f2h(float a) { return __truncsfhf2(a); }
|
||||
#else
|
||||
COMPILER_RT_ALIAS(__truncsfhf2, __aeabi_f2h)
|
||||
#endif
|
||||
#endif
|
24
third_party/compiler_rt/trunctfsf2.c
vendored
24
third_party/compiler_rt/trunctfsf2.c
vendored
|
@ -1,24 +0,0 @@
|
|||
//===-- lib/trunctfsf2.c - quad -> single conversion --------------*- C -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
__static_yoink("huge_compiler_rt_license");
|
||||
|
||||
#define QUAD_PRECISION
|
||||
#include "third_party/compiler_rt/fp_lib.inc"
|
||||
|
||||
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
|
||||
#define SRC_QUAD
|
||||
#define DST_SINGLE
|
||||
#include "third_party/compiler_rt/fp_trunc_impl.inc"
|
||||
|
||||
COMPILER_RT_ABI float __trunctfsf2(long double a) {
|
||||
return __truncXfYf2__(a);
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue