//===-- Common utilities for half-precision exponential functions ---------===// // // 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_MATH_GENERIC_EXPXF16_H #define LLVM_LIBC_SRC_MATH_GENERIC_EXPXF16_H #include "src/__support/CPP/array.h" #include "src/__support/FPUtil/PolyEval.h" #include "src/__support/FPUtil/multiply_add.h" #include "src/__support/FPUtil/nearest_integer.h" #include "src/__support/macros/attributes.h" #include "src/__support/macros/config.h" #include <stdint.h> namespace LIBC_NAMESPACE_DECL { // Generated by Sollya with the following commands: // > display = hexadecimal; // > for i from -18 to 12 do print(round(exp(i), SG, RN)); static constexpr cpp::array<float, 31> EXP_HI = …; // Generated by Sollya with the following commands: // > display = hexadecimal; // > for i from 0 to 7 do print(round(exp(i * 2^-3), SG, RN)); static constexpr cpp::array<float, 8> EXP_MID = …; struct ExpRangeReduction { … }; LIBC_INLINE ExpRangeReduction exp_range_reduction(float16 x) { … } // Generated by Sollya with the following commands: // > display = hexadecimal; // > for i from 0 to 7 do printsingle(round(2^(i * 2^-3), SG, RN)); constexpr cpp::array<uint32_t, 8> EXP2_MID_BITS = …; } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_MATH_GENERIC_EXPXF16_H