//===-- ScalarFuncs.def - Library information ----------*- C++ -*----------===//
//
//===----------------------------------------------------------------------===//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Copyright (c) 2015 Advanced Micro Devices, Inc.  All rights reserved.
// Developed by: Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// with the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimers.
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimers in the documentation
// and/or other materials provided with the distribution.
// Neither the names of Advanced Micro Devices, Inc., nor the names of its
// contributors may be used to endorse or promote products derived from this
// Software without specific prior written permission.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
// THE SOFTWARE.
//
//===----------------------------------------------------------------------===//

// This .def file creates mapping from standard IEEE math functions
// their corresponding entries in the IBM MASS (scalar) library.

#if defined(TLI_DEFINE_SCALAR_AOCL_FUNCS)
#define TLI_DEFINE_SCALAR_AOCL_FUNC(SCAL, AOCLENTRY) {SCAL, AOCLENTRY},

TLI_DEFINE_SCALAR_AOCL_FUNC("acos", "amd_fastacos")
TLI_DEFINE_SCALAR_AOCL_FUNC("__acos_finite", "amd_fastacos")

TLI_DEFINE_SCALAR_AOCL_FUNC("asinf", "amd_fastasinf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__asinf_finite", "amd_fastasinf")
TLI_DEFINE_SCALAR_AOCL_FUNC("asin", "amd_fastasin")
TLI_DEFINE_SCALAR_AOCL_FUNC("__asin_finite", "amd_fastasin")

TLI_DEFINE_SCALAR_AOCL_FUNC("atanf", "amd_fastatanf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__atanf_finite", "amd_fastatanf")
TLI_DEFINE_SCALAR_AOCL_FUNC("atan", "amd_fastatan")
TLI_DEFINE_SCALAR_AOCL_FUNC("__atan_finite", "amd_fastatan")

TLI_DEFINE_SCALAR_AOCL_FUNC("erff", "amd_fasterff")
TLI_DEFINE_SCALAR_AOCL_FUNC("__erff_finite", "amd_fasterff")
TLI_DEFINE_SCALAR_AOCL_FUNC("erf", "amd_fasterf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__erf_finite", "amd_fasterf")

TLI_DEFINE_SCALAR_AOCL_FUNC("expf", "amd_fastexpf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__expf_finite", "amd_fastexpf")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.exp.f32", "amd_fastexpf")
TLI_DEFINE_SCALAR_AOCL_FUNC("exp", "amd_fastexp")
TLI_DEFINE_SCALAR_AOCL_FUNC("__exp_finite", "amd_fastexp")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.exp.f64", "amd_fastexp")

TLI_DEFINE_SCALAR_AOCL_FUNC("logf", "amd_fastlogf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__logf_finite", "amd_fastlogf")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.log.f32", "amd_fastlogf")
TLI_DEFINE_SCALAR_AOCL_FUNC("log", "amd_fastlog")
TLI_DEFINE_SCALAR_AOCL_FUNC("__log_finite", "amd_fastlog")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.log.f64", "amd_fastlog")

TLI_DEFINE_SCALAR_AOCL_FUNC("powf", "amd_fastpowf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__powf_finite", "amd_fastpowf")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.pow.f32", "amd_fastpowf")

TLI_DEFINE_SCALAR_AOCL_FUNC("tanf", "amd_fasttanf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__tanf_finite", "amd_fasttanf")
TLI_DEFINE_SCALAR_AOCL_FUNC("tan", "amd_fasttan")
TLI_DEFINE_SCALAR_AOCL_FUNC("__tan_finite", "amd_fasttan")

#undef TLI_DEFINE_SCALAR_AOCL_FUNC
#endif
#undef TLI_DEFINE_SCALAR_AOCL_FUNCS

#if defined(TLI_DEFINE_NEW_SCALAR_AOCL_FUNCS)
#define TLI_DEFINE_SCALAR_AOCL_FUNC(SCAL, AOCLENTRY) {SCAL, AOCLENTRY},

TLI_DEFINE_SCALAR_AOCL_FUNC("acosf", "amd_fastacosf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__acosf_finite", "amd_fastacosf")

TLI_DEFINE_SCALAR_AOCL_FUNC("cosf", "amd_fastcosf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__cosf_finite", "amd_fastcosf")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.cos.f32", "amd_fastcosf")
TLI_DEFINE_SCALAR_AOCL_FUNC("cos", "amd_fastcos")
TLI_DEFINE_SCALAR_AOCL_FUNC("__cos_finite", "amd_fastcos")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.cos.f64", "amd_fastcos")

TLI_DEFINE_SCALAR_AOCL_FUNC("pow", "amd_fastpow")
TLI_DEFINE_SCALAR_AOCL_FUNC("__pow_finite", "amd_fastpow")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.pow.f64", "amd_fastpow")

TLI_DEFINE_SCALAR_AOCL_FUNC("sinf", "amd_fastsinf")
TLI_DEFINE_SCALAR_AOCL_FUNC("__sinf_finite", "amd_fastsinf")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.sin.f32", "amd_fastsinf")
TLI_DEFINE_SCALAR_AOCL_FUNC("sin", "amd_fastsin")
TLI_DEFINE_SCALAR_AOCL_FUNC("__sin_finite", "amd_fastsin")
TLI_DEFINE_SCALAR_AOCL_FUNC("llvm.sin.f64", "amd_fastsin")

#undef TLI_DEFINE_SCALAR_AOCL_FUNC
#endif

#undef TLI_DEFINE_NEW_SCALAR_AOCL_FUNCS
