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 exp2f.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIBC_SRC___SUPPORT_MATH_EXP2F_H
15#define LLVM_LIBC_SRC___SUPPORT_MATH_EXP2F_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/exp2f_float_eval.h"
27#define LIBC_MATH_EXP2F_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/exp2f_integer_eval.h"
34#define LIBC_MATH_EXP2F_IMPL integer_eval
35
36#else
37
38#include "src/__support/math/exp2f_double_eval.h"
39#define LIBC_MATH_EXP2F_IMPL double_eval
40
41#endif
42
43namespace LIBC_NAMESPACE_DECL {
44namespace math {
45
46using LIBC_MATH_EXP2F_IMPL::exp2f;
47
48} // namespace math
49} // namespace LIBC_NAMESPACE_DECL
50
51#undef LIBC_MATH_EXP2F_IMPL
52
53#endif // LLVM_LIBC_SRC___SUPPORT_MATH_EXP2F_H
54