[llvm-branch-commits] [compiler-rt] [libc] [compiler-rt][builtins] libc-backed int-to-quad conversion builtins (PR #215725)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 11 22:46:40 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 to quad precision 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 31.04 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/215725.diff


23 Files Affected:

- (modified) compiler-rt/lib/builtins/CMakeLists.txt (+6) 
- (added) compiler-rt/lib/builtins/floatditf.cpp (+26) 
- (added) compiler-rt/lib/builtins/floatsitf.cpp (+26) 
- (added) compiler-rt/lib/builtins/floattitf.cpp (+26) 
- (added) compiler-rt/lib/builtins/floatunditf.cpp (+26) 
- (added) compiler-rt/lib/builtins/floatunsitf.cpp (+26) 
- (added) compiler-rt/lib/builtins/floatuntitf.cpp (+26) 
- (modified) libc/shared/builtins.h (+6) 
- (added) libc/shared/builtins/floatditf.h (+35) 
- (added) libc/shared/builtins/floatsitf.h (+35) 
- (added) libc/shared/builtins/floattitf.h (+36) 
- (added) libc/shared/builtins/floatunditf.h (+35) 
- (added) libc/shared/builtins/floatunsitf.h (+35) 
- (added) libc/shared/builtins/floatuntitf.h (+36) 
- (modified) libc/src/__support/builtins/CMakeLists.txt (+68) 
- (added) libc/src/__support/builtins/floatditf.h (+40) 
- (added) libc/src/__support/builtins/floatsitf.h (+40) 
- (added) libc/src/__support/builtins/floattitf.h (+41) 
- (added) libc/src/__support/builtins/floatunditf.h (+40) 
- (added) libc/src/__support/builtins/floatunsitf.h (+40) 
- (added) libc/src/__support/builtins/floatuntitf.h (+41) 
- (modified) libc/test/shared/CMakeLists.txt (+7-1) 
- (modified) libc/test/shared/shared_builtins_test.cpp (+24) 


``````````diff
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index a4393e10559b0..73c2743ec7abe 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -314,14 +314,20 @@ if(COMPILER_RT_USE_LIBC_MATH)
   use_libc_builtin(GENERIC_SOURCES    floatdidf)
   use_libc_builtin(GENERIC_SOURCES    floattidf)
   use_libc_builtin(GENERIC_SOURCES    floatsisf)
+  use_libc_builtin(GENERIC_TF_SOURCES floatsitf)
   use_libc_builtin(GENERIC_SOURCES    floatdisf)
+  use_libc_builtin(GENERIC_TF_SOURCES floatditf)
   use_libc_builtin(GENERIC_SOURCES    floattisf)
+  use_libc_builtin(GENERIC_TF_SOURCES floattitf)
   use_libc_builtin(GENERIC_SOURCES    floatunsidf)
   use_libc_builtin(GENERIC_SOURCES    floatundidf)
   use_libc_builtin(GENERIC_SOURCES    floatuntidf)
   use_libc_builtin(GENERIC_SOURCES    floatunsisf)
+  use_libc_builtin(GENERIC_TF_SOURCES floatunsitf)
   use_libc_builtin(GENERIC_SOURCES    floatundisf)
+  use_libc_builtin(GENERIC_TF_SOURCES floatunditf)
   use_libc_builtin(GENERIC_SOURCES    floatuntisf)
+  use_libc_builtin(GENERIC_TF_SOURCES floatuntitf)
   use_libc_builtin(GENERIC_SOURCES    muldf3)
   use_libc_builtin(GENERIC_SOURCES    mulsf3)
   use_libc_builtin(GENERIC_TF_SOURCES multf3)
diff --git a/compiler-rt/lib/builtins/floatditf.cpp b/compiler-rt/lib/builtins/floatditf.cpp
new file mode 100644
index 0000000000000..99adc4f7af66f
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatditf.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floatditf, int64_t -> float128
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatditf.
+///
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/floatditf.h"
+
+#if defined(CRT_HAS_TF_MODE)
+extern "C" COMPILER_RT_ABI fp_t __floatditf(di_int a) {
+  return LIBC_NAMESPACE::shared::floatditf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatsitf.cpp b/compiler-rt/lib/builtins/floatsitf.cpp
new file mode 100644
index 0000000000000..a56323253d94c
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatsitf.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floatsitf, int32_t -> float128
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatsitf.
+///
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/floatsitf.h"
+
+#if defined(CRT_HAS_TF_MODE)
+extern "C" COMPILER_RT_ABI fp_t __floatsitf(si_int a) {
+  return LIBC_NAMESPACE::shared::floatsitf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floattitf.cpp b/compiler-rt/lib/builtins/floattitf.cpp
new file mode 100644
index 0000000000000..f36ce1a63804e
--- /dev/null
+++ b/compiler-rt/lib/builtins/floattitf.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floattitf, __int128_t -> float128
+/// conversion (round to nearest), on top of LLVM-libc's shared::floattitf.
+///
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/floattitf.h"
+
+#if defined(CRT_HAS_TF_MODE)
+extern "C" COMPILER_RT_ABI fp_t __floattitf(ti_int a) {
+  return LIBC_NAMESPACE::shared::floattitf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatunditf.cpp b/compiler-rt/lib/builtins/floatunditf.cpp
new file mode 100644
index 0000000000000..53764215a58b1
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatunditf.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floatunditf, uint64_t -> float128
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatunditf.
+///
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/floatunditf.h"
+
+#if defined(CRT_HAS_TF_MODE)
+extern "C" COMPILER_RT_ABI fp_t __floatunditf(du_int a) {
+  return LIBC_NAMESPACE::shared::floatunditf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatunsitf.cpp b/compiler-rt/lib/builtins/floatunsitf.cpp
new file mode 100644
index 0000000000000..f94cef9c96e9b
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatunsitf.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floatunsitf, uint32_t -> float128
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatunsitf.
+///
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/floatunsitf.h"
+
+#if defined(CRT_HAS_TF_MODE)
+extern "C" COMPILER_RT_ABI fp_t __floatunsitf(su_int a) {
+  return LIBC_NAMESPACE::shared::floatunsitf(a);
+}
+#endif
diff --git a/compiler-rt/lib/builtins/floatuntitf.cpp b/compiler-rt/lib/builtins/floatuntitf.cpp
new file mode 100644
index 0000000000000..6fd73c246b384
--- /dev/null
+++ b/compiler-rt/lib/builtins/floatuntitf.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floatuntitf, __uint128_t -> float128
+/// conversion (round to nearest), on top of LLVM-libc's shared::floatuntitf.
+///
+//===----------------------------------------------------------------------===//
+
+#define QUAD_PRECISION
+#include "fp_lib.h"
+
+#include "fp_libc_config.h"
+#include "int_lib.h"
+#include "shared/builtins/floatuntitf.h"
+
+#if defined(CRT_HAS_TF_MODE)
+extern "C" COMPILER_RT_ABI fp_t __floatuntitf(tu_int a) {
+  return LIBC_NAMESPACE::shared::floatuntitf(a);
+}
+#endif
diff --git a/libc/shared/builtins.h b/libc/shared/builtins.h
index 29380688849e5..6e59031aa28a3 100644
--- a/libc/shared/builtins.h
+++ b/libc/shared/builtins.h
@@ -41,16 +41,22 @@
 #include "builtins/fixunssfti.h"
 #include "builtins/floatdidf.h"
 #include "builtins/floatdisf.h"
+#include "builtins/floatditf.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/floatundidf.h"
 #include "builtins/floatundisf.h"
+#include "builtins/floatunditf.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/gedf2.h"
 #include "builtins/gesf2.h"
 #include "builtins/getf2.h"
diff --git a/libc/shared/builtins/floatditf.h b/libc/shared/builtins/floatditf.h
new file mode 100644
index 0000000000000..eed3e486d203d
--- /dev/null
+++ b/libc/shared/builtins/floatditf.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 __floatditf implementation as
+/// shared::floatditf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATDITF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATDITF_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floatditf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floatditf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATDITF_H
diff --git a/libc/shared/builtins/floatsitf.h b/libc/shared/builtins/floatsitf.h
new file mode 100644
index 0000000000000..b5d71e468a386
--- /dev/null
+++ b/libc/shared/builtins/floatsitf.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 __floatsitf implementation as
+/// shared::floatsitf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATSITF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATSITF_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floatsitf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floatsitf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATSITF_H
diff --git a/libc/shared/builtins/floattitf.h b/libc/shared/builtins/floattitf.h
new file mode 100644
index 0000000000000..4cdbffa709975
--- /dev/null
+++ b/libc/shared/builtins/floattitf.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 __floattitf implementation as
+/// shared::floattitf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATTITF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATTITF_H
+
+#include "include/llvm-libc-types/float128.h"
+#include "src/__support/macros/properties/types.h"
+
+#if defined(LIBC_TYPES_HAS_FLOAT128) && defined(LIBC_TYPES_HAS_INT128)
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floattitf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floattitf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128 && LIBC_TYPES_HAS_INT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATTITF_H
diff --git a/libc/shared/builtins/floatunditf.h b/libc/shared/builtins/floatunditf.h
new file mode 100644
index 0000000000000..6f88073e5758b
--- /dev/null
+++ b/libc/shared/builtins/floatunditf.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 __floatunditf implementation as
+/// shared::floatunditf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNDITF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNDITF_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floatunditf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floatunditf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNDITF_H
diff --git a/libc/shared/builtins/floatunsitf.h b/libc/shared/builtins/floatunsitf.h
new file mode 100644
index 0000000000000..4c85c7b4e9986
--- /dev/null
+++ b/libc/shared/builtins/floatunsitf.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 __floatunsitf implementation as
+/// shared::floatunsitf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNSITF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNSITF_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floatunsitf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floatunsitf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNSITF_H
diff --git a/libc/shared/builtins/floatuntitf.h b/libc/shared/builtins/floatuntitf.h
new file mode 100644
index 0000000000000..26594dbda3d13
--- /dev/null
+++ b/libc/shared/builtins/floatuntitf.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 __floatuntitf implementation as
+/// shared::floatuntitf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNTITF_H
+#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNTITF_H
+
+#include "include/llvm-libc-types/float128.h"
+#include "src/__support/macros/properties/types.h"
+
+#if defined(LIBC_TYPES_HAS_FLOAT128) && defined(LIBC_TYPES_HAS_INT128)
+
+#include "shared/libc_common.h"
+#include "src/__support/builtins/floatuntitf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using builtins::floatuntitf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128 && LIBC_TYPES_HAS_INT128
+
+#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNTITF_H
diff --git a/libc/src/__support/builtins/CMakeLists.txt b/libc/src/__support/builtins/CMakeLists.txt
index 0f41b07a10bbb..5307462794c20 100644
--- a/libc/src/__support/builtins/CMakeLists.txt
+++ b/libc/src/__support/builtins/CMakeLists.txt
@@ -572,3 +572,71 @@ add_header_library(
     libc.src.__support.builtins.cmp_helper
     libc.src.__support.macros.config
 )
+
+add_header_library(
+  floatsitf
+  HDRS
+    floatsitf.h
+  DEPENDS
+    libc.hdr.stdint_proxy
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.builtins.floatint_helper
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  floatditf
+  HDRS
+    floatditf.h
+  DEPENDS
+    libc.hdr.stdint_proxy
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.builtins.floatint_helper
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  floattitf
+  HDRS
+    floattitf.h
+  DEPENDS
+    libc.hdr.stdint_proxy
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.builtins.floatint_helper
+    libc.src.__support.macros.config
+    libc.src.__support.macros.properties.types
+)
+
+add_header_library(
+  floatunsitf
+  HDRS
+    floatunsitf.h
+  DEPENDS
+    libc.hdr.stdint_proxy
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.builtins.floatint_helper
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  floatunditf
+  HDRS
+    floatunditf.h
+  DEPENDS
+    libc.hdr.stdint_proxy
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.builtins.floatint_helper
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  floatuntitf
+  HDRS
+    floatuntitf.h
+  DEPENDS
+    libc.hdr.stdint_proxy
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.builtins.floatint_helper
+    libc.src.__support.macros.config
+    libc.src.__support.macros.properties.types
+)
diff --git a/libc/src/__support/builtins/floatditf.h b/libc/src/__support/builtins/floatditf.h
new file mode 100644
index 0000000000000..110a6350ce299
--- /dev/null
+++ b/libc/src/__support/builtins/floatditf.h
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 __floatditf implementation as
+/// builtins::floatditf so that it can be reused by compiler-rt's builtins.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDITF_H
+#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDITF_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "hdr/stdint_proxy.h"
+#include "src/__support/builtins/floatint_helper.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace builtins {
+
+// float128 <- int64_t conversion, r...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/215725


More information about the llvm-branch-commits mailing list