summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/setpayloadsigf128.cpp
diff options
context:
space:
mode:
authorJob Henandez Lara <hj93@protonmail.com>2024-08-07 21:17:20 -0700
committerGitHub <noreply@github.com>2024-08-08 00:17:20 -0400
commitaae7c38827ff7be9cc94b2e78d10742699ab506c (patch)
treecd0ea75f5b9486a315976f23e7f0a1e4a35415d8 /libc/src/math/generic/setpayloadsigf128.cpp
parent8c7a038f9029c675f2a52ff5e85f7b6005ec7b3e (diff)
[libc][math][c23] Add entrypoints and tests for setpayloadsig{,f,l,f128} and setpayloadl. (#102413)
Diffstat (limited to 'libc/src/math/generic/setpayloadsigf128.cpp')
-rw-r--r--libc/src/math/generic/setpayloadsigf128.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/libc/src/math/generic/setpayloadsigf128.cpp b/libc/src/math/generic/setpayloadsigf128.cpp
new file mode 100644
index 000000000000..97f6a36e229e
--- /dev/null
+++ b/libc/src/math/generic/setpayloadsigf128.cpp
@@ -0,0 +1,20 @@
+//===-- Implementation of setpayloadsigf128 function ----------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/setpayloadsigf128.h"
+#include "src/__support/FPUtil/BasicOperations.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, setpayloadsigf128, (float128 * res, float128 pl)) {
+ return static_cast<int>(fputil::setpayload</*IsSignaling=*/true>(*res, pl));
+}
+
+} // namespace LIBC_NAMESPACE_DECL