[libc-commits] [libc] [llvm] [libc][math] Refactor payload_functions family to header-only (PR #181824)

via libc-commits libc-commits at lists.llvm.org
Tue Feb 17 05:59:57 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Anonmiraj (AnonMiraj)

<details>
<summary>Changes</summary>

Refactors the payload_functions math family to be header-only.

Closes https://github.com/llvm/llvm-project/issues/181823

Target Functions:
  - getpayload
  - getpayloadbf16
  - getpayloadf
  - getpayloadf128
  - getpayloadf16
  - getpayloadl
  - setpayload
  - setpayloadbf16
  - setpayloadf
  - setpayloadf128
  - setpayloadf16
  - setpayloadl
  - setpayloadsig
  - setpayloadsigbf16
  - setpayloadsigf
  - setpayloadsigf128
  - setpayloadsigf16
  - setpayloadsigl

---

Patch is 75.15 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/181824.diff


60 Files Affected:

- (modified) libc/shared/math.h (+18) 
- (added) libc/shared/math/getpayload.h (+22) 
- (added) libc/shared/math/getpayloadbf16.h (+22) 
- (added) libc/shared/math/getpayloadf.h (+22) 
- (added) libc/shared/math/getpayloadf128.h (+28) 
- (added) libc/shared/math/getpayloadf16.h (+28) 
- (added) libc/shared/math/getpayloadl.h (+22) 
- (added) libc/shared/math/setpayload.h (+22) 
- (added) libc/shared/math/setpayloadbf16.h (+22) 
- (added) libc/shared/math/setpayloadf.h (+22) 
- (added) libc/shared/math/setpayloadf128.h (+28) 
- (added) libc/shared/math/setpayloadf16.h (+28) 
- (added) libc/shared/math/setpayloadl.h (+22) 
- (added) libc/shared/math/setpayloadsig.h (+22) 
- (added) libc/shared/math/setpayloadsigbf16.h (+22) 
- (added) libc/shared/math/setpayloadsigf.h (+22) 
- (added) libc/shared/math/setpayloadsigf128.h (+28) 
- (added) libc/shared/math/setpayloadsigf16.h (+28) 
- (added) libc/shared/math/setpayloadsigl.h (+22) 
- (modified) libc/src/__support/math/CMakeLists.txt (+171) 
- (added) libc/src/__support/math/getpayload.h (+26) 
- (added) libc/src/__support/math/getpayloadbf16.h (+27) 
- (added) libc/src/__support/math/getpayloadf.h (+24) 
- (added) libc/src/__support/math/getpayloadf128.h (+32) 
- (added) libc/src/__support/math/getpayloadf16.h (+32) 
- (added) libc/src/__support/math/getpayloadl.h (+26) 
- (added) libc/src/__support/math/setpayload.h (+26) 
- (added) libc/src/__support/math/setpayloadbf16.h (+27) 
- (added) libc/src/__support/math/setpayloadf.h (+26) 
- (added) libc/src/__support/math/setpayloadf128.h (+32) 
- (added) libc/src/__support/math/setpayloadf16.h (+32) 
- (added) libc/src/__support/math/setpayloadl.h (+26) 
- (added) libc/src/__support/math/setpayloadsig.h (+26) 
- (added) libc/src/__support/math/setpayloadsigbf16.h (+27) 
- (added) libc/src/__support/math/setpayloadsigf.h (+26) 
- (added) libc/src/__support/math/setpayloadsigf128.h (+32) 
- (added) libc/src/__support/math/setpayloadsigf16.h (+32) 
- (added) libc/src/__support/math/setpayloadsigl.h (+26) 
- (modified) libc/src/math/generic/CMakeLists.txt (+18-36) 
- (modified) libc/src/math/generic/getpayload.cpp (+2-4) 
- (modified) libc/src/math/generic/getpayloadbf16.cpp (+2-5) 
- (modified) libc/src/math/generic/getpayloadf.cpp (+2-4) 
- (modified) libc/src/math/generic/getpayloadf128.cpp (+2-4) 
- (modified) libc/src/math/generic/getpayloadf16.cpp (+2-4) 
- (modified) libc/src/math/generic/getpayloadl.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayload.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadbf16.cpp (+2-5) 
- (modified) libc/src/math/generic/setpayloadf.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadf128.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadf16.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadl.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadsig.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadsigbf16.cpp (+2-5) 
- (modified) libc/src/math/generic/setpayloadsigf.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadsigf128.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadsigf16.cpp (+2-4) 
- (modified) libc/src/math/generic/setpayloadsigl.cpp (+2-4) 
- (modified) libc/test/shared/CMakeLists.txt (+18) 
- (modified) libc/test/shared/shared_math_test.cpp (+71) 
- (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+261-15) 


``````````diff
diff --git a/libc/shared/math.h b/libc/shared/math.h
index 93f7d6a8156cf..376ba66f94ebc 100644
--- a/libc/shared/math.h
+++ b/libc/shared/math.h
@@ -82,6 +82,12 @@
 #include "math/fsqrt.h"
 #include "math/fsqrtf128.h"
 #include "math/fsqrtl.h"
+#include "math/getpayload.h"
+#include "math/getpayloadbf16.h"
+#include "math/getpayloadf.h"
+#include "math/getpayloadf128.h"
+#include "math/getpayloadf16.h"
+#include "math/getpayloadl.h"
 #include "math/hypotf.h"
 #include "math/hypotf16.h"
 #include "math/ilogb.h"
@@ -115,6 +121,18 @@
 #include "math/powf.h"
 #include "math/rsqrtf.h"
 #include "math/rsqrtf16.h"
+#include "math/setpayload.h"
+#include "math/setpayloadbf16.h"
+#include "math/setpayloadf.h"
+#include "math/setpayloadf128.h"
+#include "math/setpayloadf16.h"
+#include "math/setpayloadl.h"
+#include "math/setpayloadsig.h"
+#include "math/setpayloadsigbf16.h"
+#include "math/setpayloadsigf.h"
+#include "math/setpayloadsigf128.h"
+#include "math/setpayloadsigf16.h"
+#include "math/setpayloadsigl.h"
 #include "math/sin.h"
 #include "math/sincosf.h"
 #include "math/sinf.h"
diff --git a/libc/shared/math/getpayload.h b/libc/shared/math/getpayload.h
new file mode 100644
index 0000000000000..5b7c21507f268
--- /dev/null
+++ b/libc/shared/math/getpayload.h
@@ -0,0 +1,22 @@
+//===-- Shared getpayload function ------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_GETPAYLOAD_H
+#define LLVM_LIBC_SHARED_MATH_GETPAYLOAD_H
+
+#include "src/__support/math/getpayload.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::getpayload;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_GETPAYLOAD_H
diff --git a/libc/shared/math/getpayloadbf16.h b/libc/shared/math/getpayloadbf16.h
new file mode 100644
index 0000000000000..478ad4b3c6f1f
--- /dev/null
+++ b/libc/shared/math/getpayloadbf16.h
@@ -0,0 +1,22 @@
+//===-- Shared getpayloadbf16 function --------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_GETPAYLOADBF16_H
+#define LLVM_LIBC_SHARED_MATH_GETPAYLOADBF16_H
+
+#include "src/__support/math/getpayloadbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::getpayloadbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_GETPAYLOADBF16_H
diff --git a/libc/shared/math/getpayloadf.h b/libc/shared/math/getpayloadf.h
new file mode 100644
index 0000000000000..e9f64dbec99b2
--- /dev/null
+++ b/libc/shared/math/getpayloadf.h
@@ -0,0 +1,22 @@
+//===-- Shared getpayloadf function -----------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_GETPAYLOADF_H
+#define LLVM_LIBC_SHARED_MATH_GETPAYLOADF_H
+
+#include "src/__support/math/getpayloadf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::getpayloadf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_GETPAYLOADF_H
diff --git a/libc/shared/math/getpayloadf128.h b/libc/shared/math/getpayloadf128.h
new file mode 100644
index 0000000000000..7d4f5ee20d94b
--- /dev/null
+++ b/libc/shared/math/getpayloadf128.h
@@ -0,0 +1,28 @@
+//===-- Shared getpayloadf128 function --------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_GETPAYLOADF128_H
+#define LLVM_LIBC_SHARED_MATH_GETPAYLOADF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/math/getpayloadf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::getpayloadf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_GETPAYLOADF128_H
diff --git a/libc/shared/math/getpayloadf16.h b/libc/shared/math/getpayloadf16.h
new file mode 100644
index 0000000000000..1494d6cf3107d
--- /dev/null
+++ b/libc/shared/math/getpayloadf16.h
@@ -0,0 +1,28 @@
+//===-- Shared getpayloadf16 function ---------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_GETPAYLOADF16_H
+#define LLVM_LIBC_SHARED_MATH_GETPAYLOADF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/math/getpayloadf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::getpayloadf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_GETPAYLOADF16_H
diff --git a/libc/shared/math/getpayloadl.h b/libc/shared/math/getpayloadl.h
new file mode 100644
index 0000000000000..066cd345be05c
--- /dev/null
+++ b/libc/shared/math/getpayloadl.h
@@ -0,0 +1,22 @@
+//===-- Shared getpayloadl function -----------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_GETPAYLOADL_H
+#define LLVM_LIBC_SHARED_MATH_GETPAYLOADL_H
+
+#include "src/__support/math/getpayloadl.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::getpayloadl;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_GETPAYLOADL_H
diff --git a/libc/shared/math/setpayload.h b/libc/shared/math/setpayload.h
new file mode 100644
index 0000000000000..c3f2d74b18b32
--- /dev/null
+++ b/libc/shared/math/setpayload.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayload function ------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOAD_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOAD_H
+
+#include "src/__support/math/setpayload.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayload;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOAD_H
diff --git a/libc/shared/math/setpayloadbf16.h b/libc/shared/math/setpayloadbf16.h
new file mode 100644
index 0000000000000..8b4aa19e085ae
--- /dev/null
+++ b/libc/shared/math/setpayloadbf16.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadbf16 function --------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADBF16_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADBF16_H
+
+#include "src/__support/math/setpayloadbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADBF16_H
diff --git a/libc/shared/math/setpayloadf.h b/libc/shared/math/setpayloadf.h
new file mode 100644
index 0000000000000..2c69bf0c14717
--- /dev/null
+++ b/libc/shared/math/setpayloadf.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadf function -----------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADF_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADF_H
+
+#include "src/__support/math/setpayloadf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADF_H
diff --git a/libc/shared/math/setpayloadf128.h b/libc/shared/math/setpayloadf128.h
new file mode 100644
index 0000000000000..e50a563964f57
--- /dev/null
+++ b/libc/shared/math/setpayloadf128.h
@@ -0,0 +1,28 @@
+//===-- Shared setpayloadf128 function --------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADF128_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/math/setpayloadf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADF128_H
diff --git a/libc/shared/math/setpayloadf16.h b/libc/shared/math/setpayloadf16.h
new file mode 100644
index 0000000000000..09592952effab
--- /dev/null
+++ b/libc/shared/math/setpayloadf16.h
@@ -0,0 +1,28 @@
+//===-- Shared setpayloadf16 function ---------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADF16_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/math/setpayloadf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADF16_H
diff --git a/libc/shared/math/setpayloadl.h b/libc/shared/math/setpayloadl.h
new file mode 100644
index 0000000000000..0fd3f58fb5446
--- /dev/null
+++ b/libc/shared/math/setpayloadl.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadl function -----------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADL_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADL_H
+
+#include "src/__support/math/setpayloadl.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadl;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADL_H
diff --git a/libc/shared/math/setpayloadsig.h b/libc/shared/math/setpayloadsig.h
new file mode 100644
index 0000000000000..076e64d2659ce
--- /dev/null
+++ b/libc/shared/math/setpayloadsig.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadsig function ---------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADSIG_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADSIG_H
+
+#include "src/__support/math/setpayloadsig.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadsig;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADSIG_H
diff --git a/libc/shared/math/setpayloadsigbf16.h b/libc/shared/math/setpayloadsigbf16.h
new file mode 100644
index 0000000000000..6a0319636ac74
--- /dev/null
+++ b/libc/shared/math/setpayloadsigbf16.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadsigbf16 function -----------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGBF16_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGBF16_H
+
+#include "src/__support/math/setpayloadsigbf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadsigbf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGBF16_H
diff --git a/libc/shared/math/setpayloadsigf.h b/libc/shared/math/setpayloadsigf.h
new file mode 100644
index 0000000000000..e132325c8f09e
--- /dev/null
+++ b/libc/shared/math/setpayloadsigf.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadsigf function --------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF_H
+
+#include "src/__support/math/setpayloadsigf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadsigf;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF_H
diff --git a/libc/shared/math/setpayloadsigf128.h b/libc/shared/math/setpayloadsigf128.h
new file mode 100644
index 0000000000000..057b88b3d8438
--- /dev/null
+++ b/libc/shared/math/setpayloadsigf128.h
@@ -0,0 +1,28 @@
+//===-- Shared setpayloadsigf128 function -----------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF128_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/math/setpayloadsigf128.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadsigf128;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF128_H
diff --git a/libc/shared/math/setpayloadsigf16.h b/libc/shared/math/setpayloadsigf16.h
new file mode 100644
index 0000000000000..b3a93506cf423
--- /dev/null
+++ b/libc/shared/math/setpayloadsigf16.h
@@ -0,0 +1,28 @@
+//===-- Shared setpayloadsigf16 function ------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF16_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/math/setpayloadsigf16.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadsigf16;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGF16_H
diff --git a/libc/shared/math/setpayloadsigl.h b/libc/shared/math/setpayloadsigl.h
new file mode 100644
index 0000000000000..a85c70b69f20f
--- /dev/null
+++ b/libc/shared/math/setpayloadsigl.h
@@ -0,0 +1,22 @@
+//===-- Shared setpayloadsigl function --------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGL_H
+#define LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGL_H
+
+#include "src/__support/math/setpayloadsigl.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::setpayloadsigl;
+
+} // namespace shared
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SHARED_MATH_SETPAYLOADSIGL_H
diff --git a/libc/src/__support/math/CMakeLists.txt b/libc/src/__support/math/CMakeLists.txt
index aaab78c01a891..35bcc78ec7867 100644
--- a/libc/src/__support/math/CMakeLists.txt
+++ b/libc/src/__support/math/CMakeLists.txt
@@ -744,6 +744,63 @@ add_header_library(
     libc.src.__support.FPUtil.generic.sqrt
 )
 
+add_header_library(
+  getpayload
+  HDRS
+    getpayload.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  getpayloadbf16
+  HDRS
+    getpayloadbf16.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.FPUtil.bfloat16
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  getpayloadf
+  HDRS
+    getpayloadf.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  getpayloadf128
+  HDRS
+    getpayloadf128.h
+  DEPENDS
+    libc.include.llvm-libc-types.float128
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  getpayloadf16
+  HDRS
+    getpayloadf16.h
+  DEPENDS
+    libc.include.llvm-libc-macros.float16_macros
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  getpayloadl
+  HDRS
+    getpayloadl.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.macros.config
+)
+
 add_header_library(
   inv_trigf_utils
   HDRS
@@ -1314,6 +1371,120 @@ add_header_library(
     libc.src.__support.macros.optimization
 )
 
+add_header_library(
+  setpayload
+  HDRS
+    setpayload.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.macros.config
+)
+
+add_header_library(
+  setpayloadbf16
+  HDRS
+    setpayloadbf16.h
+  DEPENDS
+    libc.src.__support.FPUtil.basic_operations
+    libc.src.__support.FPUtil.bfloat16
+    libc.src.__support.macros.config
+)
+
+add_header...
[truncated]

``````````

</details>


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


More information about the libc-commits mailing list