Skip to content

Commit 81cb9d5

Browse files
committed
Add extendhfxf2 to compiler rt
1 parent 6f3c151 commit 81cb9d5

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ set(GENERIC_SOURCES
104104
divti3.c
105105
extendsfdf2.c
106106
extendhfsf2.c
107+
extendhfxf2.c
107108
ffsdi2.c
108109
ffssi2.c
109110
ffsti2.c
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===-- lib/extendhfxf2.c - half -> long double 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+
#define SRC_HALF
10+
#define DST_DOUBLE
11+
#include "fp_extend_impl.inc"
12+
13+
// Use a forwarding definition and noinline to implement a poor man's alias,
14+
// as there isn't a good cross-platform way of defining one.
15+
// Long double are expected to be as precise as double.
16+
COMPILER_RT_ABI NOINLINE long double __extendhfxf2(src_t a) {
17+
return (long double)__extendXfYf2__(a);
18+
}

compiler-rt/lib/builtins/macho_embedded/common.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ divsf3
6060
divsi3
6161
extendsfdf2
6262
extendhfsf2
63+
extendhfxf2
6364
ffssi2
6465
fixdfsi
6566
fixsfsi

llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ static_library("builtins") {
126126
"divsi3.c",
127127
"divti3.c",
128128
"extendhfsf2.c",
129+
"extendhfxf2.c"
129130
"extendsfdf2.c",
130131
"ffsdi2.c",
131132
"ffssi2.c",

0 commit comments

Comments
 (0)