Skip to content

Commit

Permalink
Add extendhfxf2 in compiler rt
Browse files Browse the repository at this point in the history
  • Loading branch information
biabbas committed Sep 27, 2024
1 parent 09cd5a8 commit d49e7f0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ set(GENERIC_SOURCES
divti3.c
extendsfdf2.c
extendhfsf2.c
extendhfxf2.c
ffsdi2.c
ffssi2.c
ffsti2.c
Expand Down
18 changes: 18 additions & 0 deletions compiler-rt/lib/builtins/extendhfxf2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===-- lib/extendhfxf2.c - half -> long double 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_DOUBLE
#include "fp_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.
// Long double are expected to be as precise as double.
COMPILER_RT_ABI NOINLINE long double __extendhfxf2(src_t a) {
return (long double)__extendXfYf2__(a);
}
1 change: 1 addition & 0 deletions compiler-rt/lib/builtins/macho_embedded/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ divsf3
divsi3
extendsfdf2
extendhfsf2
extendhfxf2
ffssi2
fixdfsi
fixsfsi
Expand Down

0 comments on commit d49e7f0

Please sign in to comment.