1 | //===-- Collection of utils for exp and friends -----------------*- 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_MATH_GENERIC_EXP_UTILS_H |
10 | #define LLVM_LIBC_SRC_MATH_GENERIC_EXP_UTILS_H |
11 | |
12 | #include <stdint.h> |
13 | |
14 | #define EXP2F_TABLE_BITS 5 |
15 | #define EXP2F_POLY_ORDER 3 |
16 | #define N (1 << EXP2F_TABLE_BITS) |
17 | |
18 | namespace LIBC_NAMESPACE { |
19 | |
20 | struct Exp2fDataTable { |
21 | uint64_t tab[1 << EXP2F_TABLE_BITS]; |
22 | double shift_scaled; |
23 | double poly[EXP2F_POLY_ORDER]; |
24 | double shift; |
25 | double invln2_scaled; |
26 | double poly_scaled[EXP2F_POLY_ORDER]; |
27 | }; |
28 | |
29 | extern const Exp2fDataTable exp2f_data; |
30 | |
31 | } // namespace LIBC_NAMESPACE |
32 | |
33 | #endif // LLVM_LIBC_SRC_MATH_GENERIC_EXP_UTILS_H |
34 | |