llvm/libc/src/math/generic/exp2f16.cpp

//===-- Half-precision 2^x function ---------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "src/math/exp2f16.h"
#include "expxf16.h"
#include "hdr/errno_macros.h"
#include "hdr/fenv_macros.h"
#include "src/__support/CPP/array.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/nearest_integer.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"

namespace LIBC_NAMESPACE_DECL {

static constexpr fputil::ExceptValues<float16, 3> EXP2F16_EXCEPTS = {{
    // (input, RZ output, RU offset, RD offset, RN offset)
    // x = 0x1.714p-11, exp2f16(x) = 0x1p+0 (RZ)
    {0x11c5U, 0x3c00U, 1U, 0U, 1U},
    // x = -0x1.558p-4, exp2f16(x) = 0x1.e34p-1 (RZ)
    {0xad56U, 0x3b8dU, 1U, 0U, 0U},
    // x = -0x1.d5cp-4, exp2f16(x) = 0x1.d8cp-1 (RZ)
    {0xaf57U, 0x3b63U, 1U, 0U, 0U},
}};

LLVM_LIBC_FUNCTION(float16, exp2f16, (float16 x)) {}

} // namespace LIBC_NAMESPACE_DECL