Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libc / src / math / generic / exp_utils.h
blob49d9a8192d344acd145c826ea4605b941a70fd1a
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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_SRC_MATH_EXP_UTILS_H
10 #define LLVM_LIBC_SRC_MATH_EXP_UTILS_H
12 #include <stdint.h>
14 #define EXP2F_TABLE_BITS 5
15 #define EXP2F_POLY_ORDER 3
16 #define N (1 << EXP2F_TABLE_BITS)
18 namespace LIBC_NAMESPACE {
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];
29 extern const Exp2fDataTable exp2f_data;
31 } // namespace LIBC_NAMESPACE
33 #endif // LLVM_LIBC_SRC_MATH_EXP_UTILS_H