[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:25 PST 2026
https://github.com/AnonMiraj created https://github.com/llvm/llvm-project/pull/181824
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
>From dc5484a99c6f20bac87580281af32fc1f484f30f Mon Sep 17 00:00:00 2001
From: Ezzeldin Ibrahim <ezzibrahimx at gmail.com>
Date: Tue, 17 Feb 2026 15:59:10 +0200
Subject: [PATCH] [libc][math] Refactor payload_functions family to header-only
Refactored functions:
- getpayload
- getpayloadbf16
- getpayloadf
- getpayloadf128
- getpayloadf16
- getpayloadl
- setpayload
- setpayloadbf16
- setpayloadf
- setpayloadf128
- setpayloadf16
- setpayloadl
- setpayloadsig
- setpayloadsigbf16
- setpayloadsigf
- setpayloadsigf128
- setpayloadsigf16
- setpayloadsigl
---
libc/shared/math.h | 18 ++
libc/shared/math/getpayload.h | 22 ++
libc/shared/math/getpayloadbf16.h | 22 ++
libc/shared/math/getpayloadf.h | 22 ++
libc/shared/math/getpayloadf128.h | 28 ++
libc/shared/math/getpayloadf16.h | 28 ++
libc/shared/math/getpayloadl.h | 22 ++
libc/shared/math/setpayload.h | 22 ++
libc/shared/math/setpayloadbf16.h | 22 ++
libc/shared/math/setpayloadf.h | 22 ++
libc/shared/math/setpayloadf128.h | 28 ++
libc/shared/math/setpayloadf16.h | 28 ++
libc/shared/math/setpayloadl.h | 22 ++
libc/shared/math/setpayloadsig.h | 22 ++
libc/shared/math/setpayloadsigbf16.h | 22 ++
libc/shared/math/setpayloadsigf.h | 22 ++
libc/shared/math/setpayloadsigf128.h | 28 ++
libc/shared/math/setpayloadsigf16.h | 28 ++
libc/shared/math/setpayloadsigl.h | 22 ++
libc/src/__support/math/CMakeLists.txt | 171 +++++++++++
libc/src/__support/math/getpayload.h | 26 ++
libc/src/__support/math/getpayloadbf16.h | 27 ++
libc/src/__support/math/getpayloadf.h | 24 ++
libc/src/__support/math/getpayloadf128.h | 32 ++
libc/src/__support/math/getpayloadf16.h | 32 ++
libc/src/__support/math/getpayloadl.h | 26 ++
libc/src/__support/math/setpayload.h | 26 ++
libc/src/__support/math/setpayloadbf16.h | 27 ++
libc/src/__support/math/setpayloadf.h | 26 ++
libc/src/__support/math/setpayloadf128.h | 32 ++
libc/src/__support/math/setpayloadf16.h | 32 ++
libc/src/__support/math/setpayloadl.h | 26 ++
libc/src/__support/math/setpayloadsig.h | 26 ++
libc/src/__support/math/setpayloadsigbf16.h | 27 ++
libc/src/__support/math/setpayloadsigf.h | 26 ++
libc/src/__support/math/setpayloadsigf128.h | 32 ++
libc/src/__support/math/setpayloadsigf16.h | 32 ++
libc/src/__support/math/setpayloadsigl.h | 26 ++
libc/src/math/generic/CMakeLists.txt | 54 ++--
libc/src/math/generic/getpayload.cpp | 6 +-
libc/src/math/generic/getpayloadbf16.cpp | 7 +-
libc/src/math/generic/getpayloadf.cpp | 6 +-
libc/src/math/generic/getpayloadf128.cpp | 6 +-
libc/src/math/generic/getpayloadf16.cpp | 6 +-
libc/src/math/generic/getpayloadl.cpp | 6 +-
libc/src/math/generic/setpayload.cpp | 6 +-
libc/src/math/generic/setpayloadbf16.cpp | 7 +-
libc/src/math/generic/setpayloadf.cpp | 6 +-
libc/src/math/generic/setpayloadf128.cpp | 6 +-
libc/src/math/generic/setpayloadf16.cpp | 6 +-
libc/src/math/generic/setpayloadl.cpp | 6 +-
libc/src/math/generic/setpayloadsig.cpp | 6 +-
libc/src/math/generic/setpayloadsigbf16.cpp | 7 +-
libc/src/math/generic/setpayloadsigf.cpp | 6 +-
libc/src/math/generic/setpayloadsigf128.cpp | 6 +-
libc/src/math/generic/setpayloadsigf16.cpp | 6 +-
libc/src/math/generic/setpayloadsigl.cpp | 6 +-
libc/test/shared/CMakeLists.txt | 18 ++
libc/test/shared/shared_math_test.cpp | 71 +++++
.../llvm-project-overlay/libc/BUILD.bazel | 276 +++++++++++++++++-
60 files changed, 1530 insertions(+), 126 deletions(-)
create mode 100644 libc/shared/math/getpayload.h
create mode 100644 libc/shared/math/getpayloadbf16.h
create mode 100644 libc/shared/math/getpayloadf.h
create mode 100644 libc/shared/math/getpayloadf128.h
create mode 100644 libc/shared/math/getpayloadf16.h
create mode 100644 libc/shared/math/getpayloadl.h
create mode 100644 libc/shared/math/setpayload.h
create mode 100644 libc/shared/math/setpayloadbf16.h
create mode 100644 libc/shared/math/setpayloadf.h
create mode 100644 libc/shared/math/setpayloadf128.h
create mode 100644 libc/shared/math/setpayloadf16.h
create mode 100644 libc/shared/math/setpayloadl.h
create mode 100644 libc/shared/math/setpayloadsig.h
create mode 100644 libc/shared/math/setpayloadsigbf16.h
create mode 100644 libc/shared/math/setpayloadsigf.h
create mode 100644 libc/shared/math/setpayloadsigf128.h
create mode 100644 libc/shared/math/setpayloadsigf16.h
create mode 100644 libc/shared/math/setpayloadsigl.h
create mode 100644 libc/src/__support/math/getpayload.h
create mode 100644 libc/src/__support/math/getpayloadbf16.h
create mode 100644 libc/src/__support/math/getpayloadf.h
create mode 100644 libc/src/__support/math/getpayloadf128.h
create mode 100644 libc/src/__support/math/getpayloadf16.h
create mode 100644 libc/src/__support/math/getpayloadl.h
create mode 100644 libc/src/__support/math/setpayload.h
create mode 100644 libc/src/__support/math/setpayloadbf16.h
create mode 100644 libc/src/__support/math/setpayloadf.h
create mode 100644 libc/src/__support/math/setpayloadf128.h
create mode 100644 libc/src/__support/math/setpayloadf16.h
create mode 100644 libc/src/__support/math/setpayloadl.h
create mode 100644 libc/src/__support/math/setpayloadsig.h
create mode 100644 libc/src/__support/math/setpayloadsigbf16.h
create mode 100644 libc/src/__support/math/setpayloadsigf.h
create mode 100644 libc/src/__support/math/setpayloadsigf128.h
create mode 100644 libc/src/__support/math/setpayloadsigf16.h
create mode 100644 libc/src/__support/math/setpayloadsigl.h
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_library(
+ setpayloadf
+ HDRS
+ setpayloadf.h
+ DEPENDS
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadf128
+ HDRS
+ setpayloadf128.h
+ DEPENDS
+ libc.include.llvm-libc-types.float128
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadf16
+ HDRS
+ setpayloadf16.h
+ DEPENDS
+ libc.include.llvm-libc-macros.float16_macros
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadl
+ HDRS
+ setpayloadl.h
+ DEPENDS
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadsig
+ HDRS
+ setpayloadsig.h
+ DEPENDS
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadsigbf16
+ HDRS
+ setpayloadsigbf16.h
+ DEPENDS
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.FPUtil.bfloat16
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadsigf
+ HDRS
+ setpayloadsigf.h
+ DEPENDS
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadsigf128
+ HDRS
+ setpayloadsigf128.h
+ DEPENDS
+ libc.include.llvm-libc-types.float128
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadsigf16
+ HDRS
+ setpayloadsigf16.h
+ DEPENDS
+ libc.include.llvm-libc-macros.float16_macros
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
+add_header_library(
+ setpayloadsigl
+ HDRS
+ setpayloadsigl.h
+ DEPENDS
+ libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.macros.config
+)
+
add_header_library(
sqrtf16
HDRS
diff --git a/libc/src/__support/math/getpayload.h b/libc/src/__support/math/getpayload.h
new file mode 100644
index 0000000000000..5983edc827c1a
--- /dev/null
+++ b/libc/src/__support/math/getpayload.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for getpayload --------------------*- 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_SRC___SUPPORT_MATH_GETPAYLOAD_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOAD_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE double getpayload(const double *x) {
+ return fputil::getpayload(*x);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOAD_H
diff --git a/libc/src/__support/math/getpayloadbf16.h b/libc/src/__support/math/getpayloadbf16.h
new file mode 100644
index 0000000000000..a2a60d8816f1b
--- /dev/null
+++ b/libc/src/__support/math/getpayloadbf16.h
@@ -0,0 +1,27 @@
+//===-- Implementation header for getpayloadbf16 ----------------*- 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_SRC___SUPPORT_MATH_GETPAYLOADBF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADBF16_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE bfloat16 getpayloadbf16(const bfloat16 *x) {
+ return fputil::getpayload(*x);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADBF16_H
diff --git a/libc/src/__support/math/getpayloadf.h b/libc/src/__support/math/getpayloadf.h
new file mode 100644
index 0000000000000..107aab60d2fe3
--- /dev/null
+++ b/libc/src/__support/math/getpayloadf.h
@@ -0,0 +1,24 @@
+//===-- Implementation header for getpayloadf -------------------*- 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_SRC___SUPPORT_MATH_GETPAYLOADF_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADF_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE float getpayloadf(const float *x) { return fputil::getpayload(*x); }
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADF_H
diff --git a/libc/src/__support/math/getpayloadf128.h b/libc/src/__support/math/getpayloadf128.h
new file mode 100644
index 0000000000000..68d21c69dc0d5
--- /dev/null
+++ b/libc/src/__support/math/getpayloadf128.h
@@ -0,0 +1,32 @@
+//===-- Implementation header for getpayloadf128 ----------------*- 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_SRC___SUPPORT_MATH_GETPAYLOADF128_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE float128 getpayloadf128(const float128 *x) {
+ return fputil::getpayload(*x);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADF128_H
diff --git a/libc/src/__support/math/getpayloadf16.h b/libc/src/__support/math/getpayloadf16.h
new file mode 100644
index 0000000000000..46febea7973bb
--- /dev/null
+++ b/libc/src/__support/math/getpayloadf16.h
@@ -0,0 +1,32 @@
+//===-- Implementation header for getpayloadf16 -----------------*- 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_SRC___SUPPORT_MATH_GETPAYLOADF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE float16 getpayloadf16(const float16 *x) {
+ return fputil::getpayload(*x);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADF16_H
diff --git a/libc/src/__support/math/getpayloadl.h b/libc/src/__support/math/getpayloadl.h
new file mode 100644
index 0000000000000..cf82f76d8e67a
--- /dev/null
+++ b/libc/src/__support/math/getpayloadl.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for getpayloadl -------------------*- 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_SRC___SUPPORT_MATH_GETPAYLOADL_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADL_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE long double getpayloadl(const long double *x) {
+ return fputil::getpayload(*x);
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_GETPAYLOADL_H
diff --git a/libc/src/__support/math/setpayload.h b/libc/src/__support/math/setpayload.h
new file mode 100644
index 0000000000000..f9fa79ce76e1d
--- /dev/null
+++ b/libc/src/__support/math/setpayload.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for setpayload --------------------*- 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_SRC___SUPPORT_MATH_SETPAYLOAD_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOAD_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayload(double *res, double pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOAD_H
diff --git a/libc/src/__support/math/setpayloadbf16.h b/libc/src/__support/math/setpayloadbf16.h
new file mode 100644
index 0000000000000..31e02eb4f7ccb
--- /dev/null
+++ b/libc/src/__support/math/setpayloadbf16.h
@@ -0,0 +1,27 @@
+//===-- Implementation header for setpayloadbf16 ----------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADBF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADBF16_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadbf16(bfloat16 *res, bfloat16 pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADBF16_H
diff --git a/libc/src/__support/math/setpayloadf.h b/libc/src/__support/math/setpayloadf.h
new file mode 100644
index 0000000000000..2431f253956a1
--- /dev/null
+++ b/libc/src/__support/math/setpayloadf.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for setpayloadf -------------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADF_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadf(float *res, float pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF_H
diff --git a/libc/src/__support/math/setpayloadf128.h b/libc/src/__support/math/setpayloadf128.h
new file mode 100644
index 0000000000000..cf301e92c69b3
--- /dev/null
+++ b/libc/src/__support/math/setpayloadf128.h
@@ -0,0 +1,32 @@
+//===-- Implementation header for setpayloadf128 ----------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADF128_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadf128(float128 *res, float128 pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF128_H
diff --git a/libc/src/__support/math/setpayloadf16.h b/libc/src/__support/math/setpayloadf16.h
new file mode 100644
index 0000000000000..4a417f0c525eb
--- /dev/null
+++ b/libc/src/__support/math/setpayloadf16.h
@@ -0,0 +1,32 @@
+//===-- Implementation header for setpayloadf16 -----------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadf16(float16 *res, float16 pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF16_H
diff --git a/libc/src/__support/math/setpayloadl.h b/libc/src/__support/math/setpayloadl.h
new file mode 100644
index 0000000000000..d5ed051766827
--- /dev/null
+++ b/libc/src/__support/math/setpayloadl.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for setpayloadl -------------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADL_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADL_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadl(long double *res, long double pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADL_H
diff --git a/libc/src/__support/math/setpayloadsig.h b/libc/src/__support/math/setpayloadsig.h
new file mode 100644
index 0000000000000..2c19ceadfae36
--- /dev/null
+++ b/libc/src/__support/math/setpayloadsig.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for setpayloadsig -----------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADSIG_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIG_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadsig(double *res, double pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIG_H
diff --git a/libc/src/__support/math/setpayloadsigbf16.h b/libc/src/__support/math/setpayloadsigbf16.h
new file mode 100644
index 0000000000000..58bf078e7e328
--- /dev/null
+++ b/libc/src/__support/math/setpayloadsigbf16.h
@@ -0,0 +1,27 @@
+//===-- Implementation header for setpayloadsigbf16 -------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADSIGBF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGBF16_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/FPUtil/bfloat16.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadsigbf16(bfloat16 *res, bfloat16 pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGBF16_H
diff --git a/libc/src/__support/math/setpayloadsigf.h b/libc/src/__support/math/setpayloadsigf.h
new file mode 100644
index 0000000000000..95a0540eb4444
--- /dev/null
+++ b/libc/src/__support/math/setpayloadsigf.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for setpayloadsigf ----------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADSIGF_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGF_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadsigf(float *res, float pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGF_H
diff --git a/libc/src/__support/math/setpayloadsigf128.h b/libc/src/__support/math/setpayloadsigf128.h
new file mode 100644
index 0000000000000..fa49c1d58653a
--- /dev/null
+++ b/libc/src/__support/math/setpayloadsigf128.h
@@ -0,0 +1,32 @@
+//===-- Implementation header for setpayloadsigf128 -------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADSIGF128_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGF128_H
+
+#include "include/llvm-libc-types/float128.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT128
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadsigf128(float128 *res, float128 pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT128
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGF128_H
diff --git a/libc/src/__support/math/setpayloadsigf16.h b/libc/src/__support/math/setpayloadsigf16.h
new file mode 100644
index 0000000000000..e3629cfe3d00e
--- /dev/null
+++ b/libc/src/__support/math/setpayloadsigf16.h
@@ -0,0 +1,32 @@
+//===-- Implementation header for setpayloadsigf16 --------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADSIGF16_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGF16_H
+
+#include "include/llvm-libc-macros/float16-macros.h"
+
+#ifdef LIBC_TYPES_HAS_FLOAT16
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadsigf16(float16 *res, float16 pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LIBC_TYPES_HAS_FLOAT16
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGF16_H
diff --git a/libc/src/__support/math/setpayloadsigl.h b/libc/src/__support/math/setpayloadsigl.h
new file mode 100644
index 0000000000000..9b9de4109e06f
--- /dev/null
+++ b/libc/src/__support/math/setpayloadsigl.h
@@ -0,0 +1,26 @@
+//===-- Implementation header for setpayloadsigl ----------------*- 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_SRC___SUPPORT_MATH_SETPAYLOADSIGL_H
+#define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGL_H
+
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace math {
+
+LIBC_INLINE int setpayloadsigl(long double *res, long double pl) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace math
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADSIGL_H
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index 75b51b4587bea..d89b04fc8dcaa 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -4602,7 +4602,7 @@ add_entrypoint_object(
HDRS
../getpayload.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.getpayload
)
add_entrypoint_object(
@@ -4612,7 +4612,7 @@ add_entrypoint_object(
HDRS
../getpayloadf.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.getpayloadf
)
add_entrypoint_object(
@@ -4622,7 +4622,7 @@ add_entrypoint_object(
HDRS
../getpayloadl.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.getpayloadl
)
add_entrypoint_object(
@@ -4632,8 +4632,7 @@ add_entrypoint_object(
HDRS
../getpayloadf16.h
DEPENDS
- libc.src.__support.macros.properties.types
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.getpayloadf16
)
add_entrypoint_object(
@@ -4643,8 +4642,7 @@ add_entrypoint_object(
HDRS
../getpayloadf128.h
DEPENDS
- libc.src.__support.macros.properties.types
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.getpayloadf128
)
add_entrypoint_object(
@@ -4654,11 +4652,7 @@ add_entrypoint_object(
HDRS
../getpayloadbf16.h
DEPENDS
- libc.src.__support.common
- libc.src.__support.FPUtil.basic_operations
- libc.src.__support.FPUtil.bfloat16
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
+ libc.src.__support.math.getpayloadbf16
)
add_entrypoint_object(
@@ -4668,7 +4662,7 @@ add_entrypoint_object(
HDRS
../setpayload.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayload
)
add_entrypoint_object(
@@ -4678,7 +4672,7 @@ add_entrypoint_object(
HDRS
../setpayloadf.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadf
)
add_entrypoint_object(
@@ -4688,7 +4682,7 @@ add_entrypoint_object(
HDRS
../setpayloadl.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadl
)
add_entrypoint_object(
@@ -4698,8 +4692,7 @@ add_entrypoint_object(
HDRS
../setpayloadf16.h
DEPENDS
- libc.src.__support.macros.properties.types
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadf16
)
add_entrypoint_object(
@@ -4709,8 +4702,7 @@ add_entrypoint_object(
HDRS
../setpayloadf128.h
DEPENDS
- libc.src.__support.macros.properties.types
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadf128
)
add_entrypoint_object(
@@ -4720,11 +4712,7 @@ add_entrypoint_object(
HDRS
../setpayloadbf16.h
DEPENDS
- libc.src.__support.common
- libc.src.__support.FPUtil.basic_operations
- libc.src.__support.FPUtil.bfloat16
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
+ libc.src.__support.math.setpayloadbf16
)
add_entrypoint_object(
@@ -4734,7 +4722,7 @@ add_entrypoint_object(
HDRS
../setpayloadsig.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadsig
)
add_entrypoint_object(
@@ -4744,7 +4732,7 @@ add_entrypoint_object(
HDRS
../setpayloadsigf.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadsigf
)
add_entrypoint_object(
@@ -4754,7 +4742,7 @@ add_entrypoint_object(
HDRS
../setpayloadsigl.h
DEPENDS
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadsigl
)
add_entrypoint_object(
@@ -4764,8 +4752,7 @@ add_entrypoint_object(
HDRS
../setpayloadsigf16.h
DEPENDS
- libc.src.__support.macros.properties.types
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadsigf16
)
add_entrypoint_object(
@@ -4775,8 +4762,7 @@ add_entrypoint_object(
HDRS
../setpayloadsigf128.h
DEPENDS
- libc.src.__support.macros.properties.types
- libc.src.__support.FPUtil.basic_operations
+ libc.src.__support.math.setpayloadsigf128
)
add_entrypoint_object(
@@ -4786,11 +4772,7 @@ add_entrypoint_object(
HDRS
../setpayloadsigbf16.h
DEPENDS
- libc.src.__support.common
- libc.src.__support.FPUtil.basic_operations
- libc.src.__support.FPUtil.bfloat16
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
+ libc.src.__support.math.setpayloadsigbf16
)
add_entrypoint_object(
diff --git a/libc/src/math/generic/getpayload.cpp b/libc/src/math/generic/getpayload.cpp
index 14d95516c42c3..b0b61d027981e 100644
--- a/libc/src/math/generic/getpayload.cpp
+++ b/libc/src/math/generic/getpayload.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/getpayload.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/getpayload.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(double, getpayload, (const double *x)) {
- return fputil::getpayload(*x);
+ return math::getpayload(x);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/getpayloadbf16.cpp b/libc/src/math/generic/getpayloadbf16.cpp
index 544ed0a2f5c9d..6c374c9cfd9d1 100644
--- a/libc/src/math/generic/getpayloadbf16.cpp
+++ b/libc/src/math/generic/getpayloadbf16.cpp
@@ -7,15 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/getpayloadbf16.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/getpayloadbf16.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(bfloat16, getpayloadbf16, (const bfloat16 *x)) {
- return fputil::getpayload(*x);
+ return math::getpayloadbf16(x);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/getpayloadf.cpp b/libc/src/math/generic/getpayloadf.cpp
index 22db186a8c354..5ad2ce92f4749 100644
--- a/libc/src/math/generic/getpayloadf.cpp
+++ b/libc/src/math/generic/getpayloadf.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/getpayloadf.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/getpayloadf.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, getpayloadf, (const float *x)) {
- return fputil::getpayload(*x);
+ return math::getpayloadf(x);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/getpayloadf128.cpp b/libc/src/math/generic/getpayloadf128.cpp
index b57469eb7de91..ba2b1cf798f3b 100644
--- a/libc/src/math/generic/getpayloadf128.cpp
+++ b/libc/src/math/generic/getpayloadf128.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/getpayloadf128.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/getpayloadf128.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float128, getpayloadf128, (const float128 *x)) {
- return fputil::getpayload(*x);
+ return math::getpayloadf128(x);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/getpayloadf16.cpp b/libc/src/math/generic/getpayloadf16.cpp
index 34c31acf108c0..b8c8f1e063ac8 100644
--- a/libc/src/math/generic/getpayloadf16.cpp
+++ b/libc/src/math/generic/getpayloadf16.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/getpayloadf16.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/getpayloadf16.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, getpayloadf16, (const float16 *x)) {
- return fputil::getpayload(*x);
+ return math::getpayloadf16(x);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/getpayloadl.cpp b/libc/src/math/generic/getpayloadl.cpp
index 028dc1e2611c0..f48b37cc4b6ec 100644
--- a/libc/src/math/generic/getpayloadl.cpp
+++ b/libc/src/math/generic/getpayloadl.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/getpayloadl.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/getpayloadl.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(long double, getpayloadl, (const long double *x)) {
- return fputil::getpayload(*x);
+ return math::getpayloadl(x);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayload.cpp b/libc/src/math/generic/setpayload.cpp
index 7e7078c95bdce..66ec416cd2c95 100644
--- a/libc/src/math/generic/setpayload.cpp
+++ b/libc/src/math/generic/setpayload.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayload.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayload.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayload, (double *res, double pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+ return math::setpayload(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadbf16.cpp b/libc/src/math/generic/setpayloadbf16.cpp
index 49f9b9cabd6a2..ae18b019dbc93 100644
--- a/libc/src/math/generic/setpayloadbf16.cpp
+++ b/libc/src/math/generic/setpayloadbf16.cpp
@@ -7,15 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadbf16.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadbf16.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadbf16, (bfloat16 * res, bfloat16 pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+ return math::setpayloadbf16(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadf.cpp b/libc/src/math/generic/setpayloadf.cpp
index 50d2ffd22fb77..f25599caf8390 100644
--- a/libc/src/math/generic/setpayloadf.cpp
+++ b/libc/src/math/generic/setpayloadf.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadf.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadf.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadf, (float *res, float pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+ return math::setpayloadf(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadf128.cpp b/libc/src/math/generic/setpayloadf128.cpp
index a50e5efd82ceb..83a3218688a99 100644
--- a/libc/src/math/generic/setpayloadf128.cpp
+++ b/libc/src/math/generic/setpayloadf128.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadf128.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadf128.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadf128, (float128 * res, float128 pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+ return math::setpayloadf128(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadf16.cpp b/libc/src/math/generic/setpayloadf16.cpp
index 1d1445eb22432..1b89c5c404b91 100644
--- a/libc/src/math/generic/setpayloadf16.cpp
+++ b/libc/src/math/generic/setpayloadf16.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadf16.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadf16.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadf16, (float16 * res, float16 pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+ return math::setpayloadf16(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadl.cpp b/libc/src/math/generic/setpayloadl.cpp
index 486f3f9272d56..922071507843a 100644
--- a/libc/src/math/generic/setpayloadl.cpp
+++ b/libc/src/math/generic/setpayloadl.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadl.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadl.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadl, (long double *res, long double pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(*res, pl));
+ return math::setpayloadl(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsig.cpp b/libc/src/math/generic/setpayloadsig.cpp
index fa8b165ca1277..192767bc92e49 100644
--- a/libc/src/math/generic/setpayloadsig.cpp
+++ b/libc/src/math/generic/setpayloadsig.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadsig.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadsig.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadsig, (double *res, double pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+ return math::setpayloadsig(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigbf16.cpp b/libc/src/math/generic/setpayloadsigbf16.cpp
index 7a2b7c7dc66dd..774dca5334106 100644
--- a/libc/src/math/generic/setpayloadsigbf16.cpp
+++ b/libc/src/math/generic/setpayloadsigbf16.cpp
@@ -7,15 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadsigbf16.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/FPUtil/bfloat16.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadsigbf16.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadsigbf16, (bfloat16 * res, bfloat16 pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+ return math::setpayloadsigbf16(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigf.cpp b/libc/src/math/generic/setpayloadsigf.cpp
index ec9d98f2123a8..7b4b0ed694f7d 100644
--- a/libc/src/math/generic/setpayloadsigf.cpp
+++ b/libc/src/math/generic/setpayloadsigf.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadsigf.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadsigf.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadsigf, (float *res, float pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+ return math::setpayloadsigf(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigf128.cpp b/libc/src/math/generic/setpayloadsigf128.cpp
index 97f6a36e229ec..a3972286767b5 100644
--- a/libc/src/math/generic/setpayloadsigf128.cpp
+++ b/libc/src/math/generic/setpayloadsigf128.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadsigf128.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadsigf128.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadsigf128, (float128 * res, float128 pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+ return math::setpayloadsigf128(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigf16.cpp b/libc/src/math/generic/setpayloadsigf16.cpp
index 5ba9fcdb0fe18..46628bc935db6 100644
--- a/libc/src/math/generic/setpayloadsigf16.cpp
+++ b/libc/src/math/generic/setpayloadsigf16.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadsigf16.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadsigf16.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadsigf16, (float16 * res, float16 pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+ return math::setpayloadsigf16(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/math/generic/setpayloadsigl.cpp b/libc/src/math/generic/setpayloadsigl.cpp
index 446fbf5d86139..8cd15577200ee 100644
--- a/libc/src/math/generic/setpayloadsigl.cpp
+++ b/libc/src/math/generic/setpayloadsigl.cpp
@@ -7,14 +7,12 @@
//===----------------------------------------------------------------------===//
#include "src/math/setpayloadsigl.h"
-#include "src/__support/FPUtil/BasicOperations.h"
-#include "src/__support/common.h"
-#include "src/__support/macros/config.h"
+#include "src/__support/math/setpayloadsigl.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(int, setpayloadsigl, (long double *res, long double pl)) {
- return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+ return math::setpayloadsigl(res, pl);
}
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt
index 9dfbedee66a33..d38263587198f 100644
--- a/libc/test/shared/CMakeLists.txt
+++ b/libc/test/shared/CMakeLists.txt
@@ -78,6 +78,12 @@ add_fp_unittest(
libc.src.__support.math.fsqrt
libc.src.__support.math.fsqrtf128
libc.src.__support.math.fsqrtl
+ libc.src.__support.math.getpayload
+ libc.src.__support.math.getpayloadbf16
+ libc.src.__support.math.getpayloadf
+ libc.src.__support.math.getpayloadf128
+ libc.src.__support.math.getpayloadf16
+ libc.src.__support.math.getpayloadl
libc.src.__support.math.hypotf
libc.src.__support.math.hypotf16
libc.src.__support.math.ilogb
@@ -112,6 +118,18 @@ add_fp_unittest(
libc.src.__support.math.powf
libc.src.__support.math.rsqrtf
libc.src.__support.math.rsqrtf16
+ libc.src.__support.math.setpayload
+ libc.src.__support.math.setpayloadbf16
+ libc.src.__support.math.setpayloadf
+ libc.src.__support.math.setpayloadf128
+ libc.src.__support.math.setpayloadf16
+ libc.src.__support.math.setpayloadl
+ libc.src.__support.math.setpayloadsig
+ libc.src.__support.math.setpayloadsigbf16
+ libc.src.__support.math.setpayloadsigf
+ libc.src.__support.math.setpayloadsigf128
+ libc.src.__support.math.setpayloadsigf16
+ libc.src.__support.math.setpayloadsigl
libc.src.__support.math.sqrtf16
libc.src.__support.math.sin
libc.src.__support.math.sincosf
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index 2d7ee388f754d..ef8d6aa004528 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -81,6 +81,19 @@ TEST(LlvmLibcSharedMathTest, AllFloat16) {
EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizef16(&canonicalizef16_cx,
&canonicalizef16_x));
EXPECT_FP_EQ(0x0p+0f16, canonicalizef16_cx);
+
+ float16 getpayloadf16_x = 0.0f16;
+ EXPECT_FP_EQ(-0x1p+0f16,
+ LIBC_NAMESPACE::shared::getpayloadf16(&getpayloadf16_x));
+
+ float16 setpayloadf16_res = 0.0f16;
+ EXPECT_EQ(0,
+ LIBC_NAMESPACE::shared::setpayloadf16(&setpayloadf16_res, 0.0f16));
+
+ float16 setpayloadsigf16_res = 0.0f16;
+ EXPECT_EQ(1, LIBC_NAMESPACE::shared::setpayloadsigf16(&setpayloadsigf16_res,
+ 0.0f16));
+ EXPECT_FP_EQ(0x0p+0f16, setpayloadsigf16_res);
}
#endif // LIBC_TYPES_HAS_FLOAT16
@@ -142,6 +155,17 @@ TEST(LlvmLibcSharedMathTest, AllFloat) {
EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizef(&canonicalizef_cx,
&canonicalizef_x));
EXPECT_FP_EQ(0x0p+0f, canonicalizef_cx);
+
+ float getpayloadf_x = 0.0f;
+ EXPECT_FP_EQ(-0x1p+0f, LIBC_NAMESPACE::shared::getpayloadf(&getpayloadf_x));
+
+ float setpayloadf_res = 0.0f;
+ EXPECT_EQ(0, LIBC_NAMESPACE::shared::setpayloadf(&setpayloadf_res, 0.0f));
+
+ float setpayloadsigf_res = 0.0f;
+ EXPECT_EQ(1,
+ LIBC_NAMESPACE::shared::setpayloadsigf(&setpayloadsigf_res, 0.0f));
+ EXPECT_FP_EQ(0x0p+0f, setpayloadsigf_res);
}
TEST(LlvmLibcSharedMathTest, AllDouble) {
@@ -174,6 +198,16 @@ TEST(LlvmLibcSharedMathTest, AllDouble) {
EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalize(&canonicalize_cx,
&canonicalize_x));
EXPECT_FP_EQ(0.0, canonicalize_cx);
+
+ double getpayload_x = 0.0;
+ EXPECT_FP_EQ(-1.0, LIBC_NAMESPACE::shared::getpayload(&getpayload_x));
+
+ double setpayload_res = 0.0;
+ EXPECT_EQ(0, LIBC_NAMESPACE::shared::setpayload(&setpayload_res, 0.0));
+
+ double setpayloadsig_res = 0.0;
+ EXPECT_EQ(1, LIBC_NAMESPACE::shared::setpayloadsig(&setpayloadsig_res, 0.0));
+ EXPECT_FP_EQ(0.0, setpayloadsig_res);
}
TEST(LlvmLibcSharedMathTest, AllLongDouble) {
@@ -189,6 +223,17 @@ TEST(LlvmLibcSharedMathTest, AllLongDouble) {
EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizel(&canonicalizel_cx,
&canonicalizel_x));
EXPECT_FP_EQ(0x0p+0L, canonicalizel_cx);
+
+ long double getpayloadl_x = 0.0L;
+ EXPECT_FP_EQ(-0x1p+0L, LIBC_NAMESPACE::shared::getpayloadl(&getpayloadl_x));
+
+ long double setpayloadl_res = 0.0L;
+ EXPECT_EQ(0, LIBC_NAMESPACE::shared::setpayloadl(&setpayloadl_res, 0.0L));
+
+ long double setpayloadsigl_res = 0.0L;
+ EXPECT_EQ(1,
+ LIBC_NAMESPACE::shared::setpayloadsigl(&setpayloadsigl_res, 0.0L));
+ EXPECT_FP_EQ(0x0p+0L, setpayloadsigl_res);
}
#ifdef LIBC_TYPES_HAS_FLOAT128
@@ -224,6 +269,19 @@ TEST(LlvmLibcSharedMathTest, AllFloat128) {
EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizef128(&canonicalizef128_cx,
&canonicalizef128_x));
EXPECT_FP_EQ(float128(0.0), canonicalizef128_cx);
+
+ float128 getpayloadf128_x = float128(0.0);
+ EXPECT_FP_EQ(float128(-1.0),
+ LIBC_NAMESPACE::shared::getpayloadf128(&getpayloadf128_x));
+
+ float128 setpayloadf128_res = float128(0.0);
+ EXPECT_EQ(0, LIBC_NAMESPACE::shared::setpayloadf128(&setpayloadf128_res,
+ float128(0.0)));
+
+ float128 setpayloadsigf128_res = float128(0.0);
+ EXPECT_EQ(1, LIBC_NAMESPACE::shared::setpayloadsigf128(&setpayloadsigf128_res,
+ float128(0.0)));
+ EXPECT_FP_EQ(float128(0.0), setpayloadsigf128_res);
}
#endif // LIBC_TYPES_HAS_FLOAT128
@@ -236,4 +294,17 @@ TEST(LlvmLibcSharedMathTest, AllBFloat16) {
EXPECT_EQ(0, LIBC_NAMESPACE::shared::canonicalizebf16(&canonicalizebf16_cx,
&canonicalizebf16_x));
EXPECT_FP_EQ(bfloat16(0.0), canonicalizebf16_cx);
+
+ bfloat16 getpayloadbf16_x = bfloat16(0.0);
+ EXPECT_FP_EQ(bfloat16(-1.0),
+ LIBC_NAMESPACE::shared::getpayloadbf16(&getpayloadbf16_x));
+
+ bfloat16 setpayloadbf16_res = bfloat16(0.0);
+ EXPECT_EQ(0, LIBC_NAMESPACE::shared::setpayloadbf16(&setpayloadbf16_res,
+ bfloat16(0.0)));
+
+ bfloat16 setpayloadsigbf16_res = bfloat16(0.0);
+ EXPECT_EQ(1, LIBC_NAMESPACE::shared::setpayloadsigbf16(&setpayloadsigbf16_res,
+ bfloat16(0.0)));
+ EXPECT_FP_EQ(bfloat16(0.0), setpayloadsigbf16_res);
}
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 608180b90e87b..a952c12ad286d 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -2413,6 +2413,120 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_math_setpayload",
+ hdrs = ["src/__support/math/setpayload.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadbf16",
+ hdrs = ["src/__support/math/setpayloadbf16.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_fputil_bfloat16",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadf",
+ hdrs = ["src/__support/math/setpayloadf.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadf128",
+ hdrs = ["src/__support/math/setpayloadf128.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ":llvm_libc_types_float128",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadf16",
+ hdrs = ["src/__support/math/setpayloadf16.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ":llvm_libc_macros_float16_macros",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadl",
+ hdrs = ["src/__support/math/setpayloadl.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadsig",
+ hdrs = ["src/__support/math/setpayloadsig.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadsigbf16",
+ hdrs = ["src/__support/math/setpayloadsigbf16.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_fputil_bfloat16",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadsigf",
+ hdrs = ["src/__support/math/setpayloadsigf.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadsigf128",
+ hdrs = ["src/__support/math/setpayloadsigf128.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ":llvm_libc_types_float128",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadsigf16",
+ hdrs = ["src/__support/math/setpayloadsigf16.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ":llvm_libc_macros_float16_macros",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_setpayloadsigl",
+ hdrs = ["src/__support/math/setpayloadsigl.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
libc_support_library(
name = "__support_math_sqrtf16",
hdrs = ["src/__support/math/sqrtf16.h"],
@@ -3070,6 +3184,63 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_math_getpayload",
+ hdrs = ["src/__support/math/getpayload.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_getpayloadbf16",
+ hdrs = ["src/__support/math/getpayloadbf16.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_fputil_bfloat16",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_getpayloadf",
+ hdrs = ["src/__support/math/getpayloadf.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_getpayloadf128",
+ hdrs = ["src/__support/math/getpayloadf128.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ":llvm_libc_types_float128",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_getpayloadf16",
+ hdrs = ["src/__support/math/getpayloadf16.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ":llvm_libc_macros_float16_macros",
+ ],
+)
+
+libc_support_library(
+ name = "__support_math_getpayloadl",
+ hdrs = ["src/__support/math/getpayloadl.h"],
+ deps = [
+ ":__support_fputil_basic_operations",
+ ":__support_macros_config",
+ ],
+)
+
libc_support_library(
name = "__support_math_inv_trigf_utils",
hdrs = ["src/__support/math/inv_trigf_utils.h"],
@@ -5034,15 +5205,40 @@ libc_math_function(name = "fsubl")
libc_math_function(name = "fsubf128")
-libc_math_function(name = "getpayload")
+libc_math_function(
+ name = "getpayload",
+ additional_deps = [
+ ":__support_math_getpayload",
+ ],
+)
-libc_math_function(name = "getpayloadf")
+libc_math_function(
+ name = "getpayloadf",
+ additional_deps = [
+ ":__support_math_getpayloadf",
+ ],
+)
-libc_math_function(name = "getpayloadl")
+libc_math_function(
+ name = "getpayloadl",
+ additional_deps = [
+ ":__support_math_getpayloadl",
+ ],
+)
-libc_math_function(name = "getpayloadf128")
+libc_math_function(
+ name = "getpayloadf128",
+ additional_deps = [
+ ":__support_math_getpayloadf128",
+ ],
+)
-libc_math_function(name = "getpayloadf16")
+libc_math_function(
+ name = "getpayloadf16",
+ additional_deps = [
+ ":__support_math_getpayloadf16",
+ ],
+)
libc_math_function(name = "hypot")
@@ -5458,25 +5654,75 @@ libc_math_function(name = "scalbnf128")
libc_math_function(name = "scalbnf16")
-libc_math_function(name = "setpayload")
+libc_math_function(
+ name = "setpayload",
+ additional_deps = [
+ ":__support_math_setpayload",
+ ],
+)
-libc_math_function(name = "setpayloadf")
+libc_math_function(
+ name = "setpayloadf",
+ additional_deps = [
+ ":__support_math_setpayloadf",
+ ],
+)
-libc_math_function(name = "setpayloadl")
+libc_math_function(
+ name = "setpayloadl",
+ additional_deps = [
+ ":__support_math_setpayloadl",
+ ],
+)
-libc_math_function(name = "setpayloadf128")
+libc_math_function(
+ name = "setpayloadf128",
+ additional_deps = [
+ ":__support_math_setpayloadf128",
+ ],
+)
-libc_math_function(name = "setpayloadf16")
+libc_math_function(
+ name = "setpayloadf16",
+ additional_deps = [
+ ":__support_math_setpayloadf16",
+ ],
+)
-libc_math_function(name = "setpayloadsig")
+libc_math_function(
+ name = "setpayloadsig",
+ additional_deps = [
+ ":__support_math_setpayloadsig",
+ ],
+)
-libc_math_function(name = "setpayloadsigf")
+libc_math_function(
+ name = "setpayloadsigf",
+ additional_deps = [
+ ":__support_math_setpayloadsigf",
+ ],
+)
-libc_math_function(name = "setpayloadsigl")
+libc_math_function(
+ name = "setpayloadsigl",
+ additional_deps = [
+ ":__support_math_setpayloadsigl",
+ ],
+)
-libc_math_function(name = "setpayloadsigf128")
+libc_math_function(
+ name = "setpayloadsigf128",
+ additional_deps = [
+ ":__support_math_setpayloadsigf128",
+ ],
+)
-libc_math_function(name = "setpayloadsigf16")
+libc_math_function(
+ name = "setpayloadsigf16",
+ additional_deps = [
+ ":__support_math_setpayloadsigf16",
+ ],
+)
libc_math_function(
name = "sin",
More information about the libc-commits
mailing list