| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// |
| 9 | /// \file |
| 10 | /// Implementation header for setpayloadf128. |
| 11 | /// |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF128_H |
| 15 | #define LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF128_H |
| 16 | |
| 17 | #include "src/__support/FPUtil/BasicOperations.h" |
| 18 | #include "src/__support/FPUtil/float128.h" |
| 19 | #include "src/__support/macros/config.h" |
| 20 | |
| 21 | namespace LIBC_NAMESPACE_DECL { |
| 22 | |
| 23 | namespace math { |
| 24 | |
| 25 | using LIBC_NAMESPACE::fputil::Float128; |
| 26 | |
| 27 | LIBC_INLINE constexpr int setpayloadf128(Float128 *res, Float128 pl) { |
| 28 | return static_cast<int>(fputil::setpayload</*IsSignaling=*/false>(res&: *res, pl)); |
| 29 | } |
| 30 | |
| 31 | } // namespace math |
| 32 | } // namespace LIBC_NAMESPACE_DECL |
| 33 | |
| 34 | #endif // LLVM_LIBC_SRC___SUPPORT_MATH_SETPAYLOADF128_H |
| 35 | |