| 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 expf. |
| 11 | /// |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXPF_H |
| 15 | #define LLVM_LIBC_SRC___SUPPORT_MATH_EXPF_H |
| 16 | |
| 17 | #include "src/__support/common.h" |
| 18 | #include "src/__support/macros/config.h" |
| 19 | #include "src/__support/macros/optimization.h" |
| 20 | #include "src/__support/macros/properties/cpu_features.h" |
| 21 | |
| 22 | #if defined(LIBC_MATH_HAS_SKIP_ACCURATE_PASS) && \ |
| 23 | (defined(LIBC_MATH_HAS_SMALL_TABLES) || \ |
| 24 | defined(LIBC_MATH_HAS_INTERMEDIATE_COMP_IN_FLOAT)) |
| 25 | |
| 26 | #include "src/__support/math/expf_float_eval.h" |
| 27 | #define LIBC_MATH_EXPF_IMPL float_eval |
| 28 | |
| 29 | #elif !defined(LIBC_TARGET_CPU_HAS_FPU_DOUBLE) && \ |
| 30 | defined(LIBC_MATH_HAS_ASSUME_ROUND_NEAREST_ONLY) && \ |
| 31 | defined(LIBC_MATH_HAS_NO_EXCEPT) && defined(LIBC_MATH_HAS_NO_ERRNO) |
| 32 | |
| 33 | #include "src/__support/math/expf_integer_eval.h" |
| 34 | #define LIBC_MATH_EXPF_IMPL integer_eval |
| 35 | |
| 36 | #else |
| 37 | #include "src/__support/math/expf_double_eval.h" |
| 38 | #define LIBC_MATH_EXPF_IMPL double_eval |
| 39 | |
| 40 | #endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS |
| 41 | |
| 42 | namespace LIBC_NAMESPACE_DECL { |
| 43 | namespace math { |
| 44 | |
| 45 | using LIBC_MATH_EXPF_IMPL::expf; |
| 46 | |
| 47 | } // namespace math |
| 48 | } // namespace LIBC_NAMESPACE_DECL |
| 49 | |
| 50 | #undef LIBC_MATH_EXPF_IMPL |
| 51 | |
| 52 | #endif // LLVM_LIBC_SRC___SUPPORT_MATH_EXPF_H |
| 53 | |