[llvm-branch-commits] [compiler-rt] [libc] [compiler-rt][builtins] libc-backed float80-int conversion builtins (PR #215728)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 11 22:48:36 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: hulxv (hulxv)
<details>
<summary>Changes</summary>
libc-backed integer-float80 conversion builtins
Part of #<!-- -->197824
<sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
---
Patch is 45.17 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/215728.diff
32 Files Affected:
- (modified) compiler-rt/lib/builtins/CMakeLists.txt (+9)
- (added) compiler-rt/lib/builtins/fixunsxfdi.cpp (+24)
- (added) compiler-rt/lib/builtins/fixunsxfsi.cpp (+24)
- (added) compiler-rt/lib/builtins/fixunsxfti.cpp (+25)
- (added) compiler-rt/lib/builtins/fixxfdi.cpp (+24)
- (added) compiler-rt/lib/builtins/fixxfti.cpp (+24)
- (added) compiler-rt/lib/builtins/floatdixf.cpp (+24)
- (added) compiler-rt/lib/builtins/floattixf.cpp (+24)
- (added) compiler-rt/lib/builtins/floatundixf.cpp (+24)
- (added) compiler-rt/lib/builtins/floatuntixf.cpp (+24)
- (modified) libc/shared/builtins.h (+9)
- (added) libc/shared/builtins/fixunsxfdi.h (+35)
- (added) libc/shared/builtins/fixunsxfsi.h (+35)
- (added) libc/shared/builtins/fixunsxfti.h (+36)
- (added) libc/shared/builtins/fixxfdi.h (+35)
- (added) libc/shared/builtins/fixxfti.h (+36)
- (added) libc/shared/builtins/floatdixf.h (+35)
- (added) libc/shared/builtins/floattixf.h (+36)
- (added) libc/shared/builtins/floatundixf.h (+35)
- (added) libc/shared/builtins/floatuntixf.h (+36)
- (modified) libc/src/__support/builtins/CMakeLists.txt (+99)
- (added) libc/src/__support/builtins/fixunsxfdi.h (+40)
- (added) libc/src/__support/builtins/fixunsxfsi.h (+40)
- (added) libc/src/__support/builtins/fixunsxfti.h (+41)
- (added) libc/src/__support/builtins/fixxfdi.h (+40)
- (added) libc/src/__support/builtins/fixxfti.h (+41)
- (added) libc/src/__support/builtins/floatdixf.h (+40)
- (added) libc/src/__support/builtins/floattixf.h (+41)
- (added) libc/src/__support/builtins/floatundixf.h (+40)
- (added) libc/src/__support/builtins/floatuntixf.h (+41)
- (modified) libc/test/shared/CMakeLists.txt (+9)
- (modified) libc/test/shared/shared_builtins_test.cpp (+45)
``````````diff
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 5fe4adf2a2e99..8d3eee6f777be 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -340,6 +340,15 @@ if(COMPILER_RT_USE_LIBC_MATH)
use_libc_builtin(GENERIC_TF_SOURCES trunctfdf2)
use_libc_builtin(GENERIC_TF_SOURCES trunctfsf2)
use_libc_builtin(x86_80_BIT_SOURCES trunctfxf2)
+ use_libc_builtin(x86_80_BIT_SOURCES floatdixf)
+ use_libc_builtin(x86_80_BIT_SOURCES floattixf)
+ use_libc_builtin(x86_80_BIT_SOURCES floatundixf)
+ use_libc_builtin(x86_80_BIT_SOURCES floatuntixf)
+ use_libc_builtin(x86_80_BIT_SOURCES fixxfdi)
+ use_libc_builtin(x86_80_BIT_SOURCES fixxfti)
+ use_libc_builtin(x86_80_BIT_SOURCES fixunsxfsi)
+ use_libc_builtin(x86_80_BIT_SOURCES fixunsxfdi)
+ use_libc_builtin(x86_80_BIT_SOURCES fixunsxfti)
use_libc_builtin(GENERIC_TF_SOURCES fixtfsi)
use_libc_builtin(GENERIC_TF_SOURCES fixtfdi)
use_libc_builtin(GENERIC_TF_SOURCES fixtfti)
diff --git a/compiler-rt/lib/builtins/fixunsxfdi.cpp b/compiler-rt/lib/builtins/fixunsxfdi.cpp
new file mode 100644
index 0000000000000..5022f38348cc4
--- /dev/null
+++ b/compiler-rt/lib/builtins/fixunsxfdi.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __fixunsxfdi, truncating long double ->
+/// uint64_t conversion (saturating), on top of LLVM-libc's shared::fixunsxfdi.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/fixunsxfdi.h"
+
+#if !_ARCH_PPC
+extern "C" COMPILER_RT_ABI du_int __fixunsxfdi(xf_float a) {
+ return LIBC_NAMESPACE::shared::fixunsxfdi(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/fixunsxfsi.cpp b/compiler-rt/lib/builtins/fixunsxfsi.cpp
new file mode 100644
index 0000000000000..4d475d012dfd9
--- /dev/null
+++ b/compiler-rt/lib/builtins/fixunsxfsi.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __fixunsxfsi, truncating long double ->
+/// uint32_t conversion (saturating), on top of LLVM-libc's shared::fixunsxfsi.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/fixunsxfsi.h"
+
+#if !_ARCH_PPC
+extern "C" COMPILER_RT_ABI su_int __fixunsxfsi(xf_float a) {
+ return LIBC_NAMESPACE::shared::fixunsxfsi(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/fixunsxfti.cpp b/compiler-rt/lib/builtins/fixunsxfti.cpp
new file mode 100644
index 0000000000000..7136bdbf96eea
--- /dev/null
+++ b/compiler-rt/lib/builtins/fixunsxfti.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __fixunsxfti, truncating long double ->
+/// __uint128_t conversion (saturating), on top of LLVM-libc's
+/// shared::fixunsxfti.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/fixunsxfti.h"
+
+#if defined(CRT_HAS_128BIT)
+extern "C" COMPILER_RT_ABI tu_int __fixunsxfti(xf_float a) {
+ return LIBC_NAMESPACE::shared::fixunsxfti(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/fixxfdi.cpp b/compiler-rt/lib/builtins/fixxfdi.cpp
new file mode 100644
index 0000000000000..7f8b9a3bf184b
--- /dev/null
+++ b/compiler-rt/lib/builtins/fixxfdi.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __fixxfdi, truncating long double ->
+/// int64_t conversion (saturating), on top of LLVM-libc's shared::fixxfdi.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/fixxfdi.h"
+
+#if !_ARCH_PPC
+extern "C" COMPILER_RT_ABI di_int __fixxfdi(xf_float a) {
+ return LIBC_NAMESPACE::shared::fixxfdi(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/fixxfti.cpp b/compiler-rt/lib/builtins/fixxfti.cpp
new file mode 100644
index 0000000000000..193b15ea503d2
--- /dev/null
+++ b/compiler-rt/lib/builtins/fixxfti.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __fixxfti, truncating long double ->
+/// __int128_t conversion (saturating), on top of LLVM-libc's shared::fixxfti.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/fixxfti.h"
+
+#if defined(CRT_HAS_128BIT)
+extern "C" COMPILER_RT_ABI ti_int __fixxfti(xf_float a) {
+ return LIBC_NAMESPACE::shared::fixxfti(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatdixf.cpp b/compiler-rt/lib/builtins/floatdixf.cpp
new file mode 100644
index 0000000000000..7d5f30f0b1d17
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatdixf.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __floatdixf, int64_t -> long double
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatdixf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/floatdixf.h"
+
+#if !_ARCH_PPC
+extern "C" COMPILER_RT_ABI xf_float __floatdixf(di_int a) {
+ return LIBC_NAMESPACE::shared::floatdixf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floattixf.cpp b/compiler-rt/lib/builtins/floattixf.cpp
new file mode 100644
index 0000000000000..5c13e4cbc7f96
--- /dev/null
+++ b/compiler-rt/lib/builtins/floattixf.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __floattixf, __int128_t -> long double
+/// conversion (round to nearest), on top of LLVM-libc's shared::floattixf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/floattixf.h"
+
+#if defined(CRT_HAS_128BIT)
+extern "C" COMPILER_RT_ABI xf_float __floattixf(ti_int a) {
+ return LIBC_NAMESPACE::shared::floattixf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatundixf.cpp b/compiler-rt/lib/builtins/floatundixf.cpp
new file mode 100644
index 0000000000000..e8541b055e650
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatundixf.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __floatundixf, uint64_t -> long double
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatundixf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/floatundixf.h"
+
+#if !_ARCH_PPC
+extern "C" COMPILER_RT_ABI xf_float __floatundixf(du_int a) {
+ return LIBC_NAMESPACE::shared::floatundixf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatuntixf.cpp b/compiler-rt/lib/builtins/floatuntixf.cpp
new file mode 100644
index 0000000000000..8315e82a93c0b
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatuntixf.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file implements compiler-rt's __floatuntixf, __uint128_t -> long double
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatuntixf.
+///
+//===----------------------------------------------------------------------===//
+
+#include "int_lib.h"
+
+#include "fp_libc_config.h"
+#include "shared/builtins/floatuntixf.h"
+
+#if defined(CRT_HAS_128BIT)
+extern "C" COMPILER_RT_ABI xf_float __floatuntixf(tu_int a) {
+ return LIBC_NAMESPACE::shared::floatuntixf(a);
+}
+#endif
diff --git a/libc/shared/builtins.h b/libc/shared/builtins.h
index c1af1d39733ff..f44f793736702 100644
--- a/libc/shared/builtins.h
+++ b/libc/shared/builtins.h
@@ -45,24 +45,33 @@
#include "builtins/fixunstfdi.h"
#include "builtins/fixunstfsi.h"
#include "builtins/fixunstfti.h"
+#include "builtins/fixunsxfdi.h"
+#include "builtins/fixunsxfsi.h"
+#include "builtins/fixunsxfti.h"
+#include "builtins/fixxfdi.h"
+#include "builtins/fixxfti.h"
#include "builtins/floatdidf.h"
#include "builtins/floatdisf.h"
#include "builtins/floatditf.h"
+#include "builtins/floatdixf.h"
#include "builtins/floatsidf.h"
#include "builtins/floatsisf.h"
#include "builtins/floatsitf.h"
#include "builtins/floattidf.h"
#include "builtins/floattisf.h"
#include "builtins/floattitf.h"
+#include "builtins/floattixf.h"
#include "builtins/floatundidf.h"
#include "builtins/floatundisf.h"
#include "builtins/floatunditf.h"
+#include "builtins/floatundixf.h"
#include "builtins/floatunsidf.h"
#include "builtins/floatunsisf.h"
#include "builtins/floatunsitf.h"
#include "builtins/floatuntidf.h"
#include "builtins/floatuntisf.h"
#include "builtins/floatuntitf.h"
+#include "builtins/floatuntixf.h"
#include "builtins/gedf2.h"
#include "builtins/gesf2.h"
#include "builtins/getf2.h"
diff --git a/libc/shared/builtins/fixunsxfdi.h b/libc/shared/builtins/fixunsxfdi.h
new file mode 100644
index 0000000000000..1546a604c93f7
--- /dev/null
+++ b/libc/shared/builtins/fixunsxfdi.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __fixunsxfdi implementation as
+/// shared::fixunsxfdi so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFDI_H
+#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFDI_H
+
+#include "src/__support/macros/properties/types.h"
+
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/fixunsxfdi.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::fixunsxfdi;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFDI_H
diff --git a/libc/shared/builtins/fixunsxfsi.h b/libc/shared/builtins/fixunsxfsi.h
new file mode 100644
index 0000000000000..8f16a4c7192b1
--- /dev/null
+++ b/libc/shared/builtins/fixunsxfsi.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __fixunsxfsi implementation as
+/// shared::fixunsxfsi so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFSI_H
+#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFSI_H
+
+#include "src/__support/macros/properties/types.h"
+
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/fixunsxfsi.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::fixunsxfsi;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFSI_H
diff --git a/libc/shared/builtins/fixunsxfti.h b/libc/shared/builtins/fixunsxfti.h
new file mode 100644
index 0000000000000..21352a58bdc7b
--- /dev/null
+++ b/libc/shared/builtins/fixunsxfti.h
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __fixunsxfti implementation as
+/// shared::fixunsxfti so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFTI_H
+#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFTI_H
+
+#include "src/__support/macros/properties/types.h"
+
+#if defined(LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80) && \
+ defined(LIBC_TYPES_HAS_INT128)
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/fixunsxfti.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::fixunsxfti;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80 && LIBC_TYPES_HAS_INT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSXFTI_H
diff --git a/libc/shared/builtins/fixxfdi.h b/libc/shared/builtins/fixxfdi.h
new file mode 100644
index 0000000000000..139973c88fbe0
--- /dev/null
+++ b/libc/shared/builtins/fixxfdi.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __fixxfdi implementation as shared::fixxfdi
+/// so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXXFDI_H
+#define LLVM_LIBC_SHARED_BUILTINS_FIXXFDI_H
+
+#include "src/__support/macros/properties/types.h"
+
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/fixxfdi.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::fixxfdi;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FIXXFDI_H
diff --git a/libc/shared/builtins/fixxfti.h b/libc/shared/builtins/fixxfti.h
new file mode 100644
index 0000000000000..3529a427fea26
--- /dev/null
+++ b/libc/shared/builtins/fixxfti.h
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __fixxfti implementation as shared::fixxfti
+/// so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXXFTI_H
+#define LLVM_LIBC_SHARED_BUILTINS_FIXXFTI_H
+
+#include "src/__support/macros/properties/types.h"
+
+#if defined(LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80) && \
+ defined(LIBC_TYPES_HAS_INT128)
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/fixxfti.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::fixxfti;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80 && LIBC_TYPES_HAS_INT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FIXXFTI_H
diff --git a/libc/shared/builtins/floatdixf.h b/libc/shared/builtins/floatdixf.h
new file mode 100644
index 0000000000000..28ed14f1f8201
--- /dev/null
+++ b/libc/shared/builtins/floatdixf.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This header exposes LLVM-libc's __floatdixf implementation as
+/// shared::floatdixf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATDIXF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATDIXF_H
+
+#include "src/__support/macros/properties/types.h"
+
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floatdixf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floatdixf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/215728
More information about the llvm-branch-commits
mailing list