| 1 | //===-- Constants for exp10f16 function -------------------------*- C++ -*-===// |
| 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 | #ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP10_FLOAT16_CONSTANTS_H |
| 10 | #define LLVM_LIBC_SRC___SUPPORT_MATH_EXP10_FLOAT16_CONSTANTS_H |
| 11 | |
| 12 | #include "hdr/stdint_proxy.h" |
| 13 | #include "include/llvm-libc-macros/float16-macros.h" |
| 14 | |
| 15 | #ifdef LIBC_TYPES_HAS_FLOAT16 |
| 16 | |
| 17 | #include "src/__support/CPP/array.h" |
| 18 | |
| 19 | namespace LIBC_NAMESPACE_DECL { |
| 20 | |
| 21 | // Generated by Sollya with the following commands: |
| 22 | // > display = hexadecimal; |
| 23 | // > for i from 0 to 7 do printsingle(round(2^(i * 2^-3), SG, RN)); |
| 24 | LIBC_INLINE_VAR constexpr cpp::array<uint32_t, 8> EXP2_MID_BITS = { |
| 25 | 0x3f80'0000U, 0x3f8b'95c2U, 0x3f98'37f0U, 0x3fa5'fed7U, |
| 26 | 0x3fb5'04f3U, 0x3fc5'672aU, 0x3fd7'44fdU, 0x3fea'c0c7U, |
| 27 | }; |
| 28 | |
| 29 | // Generated by Sollya with the following commands: |
| 30 | // > display = hexadecimal; |
| 31 | // > round(log2(10), SG, RN); |
| 32 | LIBC_INLINE_VAR constexpr float LOG2F_10 = 0x1.a934fp+1f; |
| 33 | |
| 34 | // Generated by Sollya with the following commands: |
| 35 | // > display = hexadecimal; |
| 36 | // > round(log10(2), SG, RN); |
| 37 | LIBC_INLINE_VAR constexpr float LOG10F_2 = 0x1.344136p-2f; |
| 38 | |
| 39 | } // namespace LIBC_NAMESPACE_DECL |
| 40 | |
| 41 | #endif // LIBC_TYPES_HAS_FLOAT16 |
| 42 | |
| 43 | #endif // LLVM_LIBC_SRC___SUPPORT_MATH_EXP10_FLOAT16_CONSTANTS_H |
| 44 | |