diff options
author | Rohit Aggarwal <44664450+rohitaggarwal007@users.noreply.github.com> | 2024-02-15 12:13:07 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-15 12:13:07 +0530 |
commit | 36adfec155de366d722f2bac8ff9162289dcf06c (patch) | |
tree | bb758049e0d02e8a50d2c6b2de9a16f7787cb621 /llvm/lib/Analysis/TargetLibraryInfo.cpp | |
parent | b93916c9798ea09488e30b9b0aae9e54ef0b1956 (diff) | |
download | llvm-36adfec155de366d722f2bac8ff9162289dcf06c.zip llvm-36adfec155de366d722f2bac8ff9162289dcf06c.tar.gz llvm-36adfec155de366d722f2bac8ff9162289dcf06c.tar.bz2 |
Adding support of AMDLIBM vector library (#78560)
Hi,
AMD has it's own implementation of vector calls. This patch include the
changes to enable the use of AMD's math library using -fveclib=AMDLIBM.
Please refer https://github.com/amd/aocl-libm-ose
---------
Co-authored-by: Rohit Aggarwal <Rohit.Aggarwal@amd.com>
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/TargetLibraryInfo.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 25951d2..710762a 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -37,7 +37,9 @@ static cl::opt<TargetLibraryInfoImpl::VectorLibrary> ClVectorLibrary( clEnumValN(TargetLibraryInfoImpl::SLEEFGNUABI, "sleefgnuabi", "SIMD Library for Evaluating Elementary Functions"), clEnumValN(TargetLibraryInfoImpl::ArmPL, "ArmPL", - "Arm Performance Libraries"))); + "Arm Performance Libraries"), + clEnumValN(TargetLibraryInfoImpl::AMDLIBM, "AMDLIBM", + "AMD vector math library"))); StringLiteral const TargetLibraryInfoImpl::StandardNames[LibFunc::NumLibFuncs] = { @@ -1273,6 +1275,16 @@ void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib( } break; } + case AMDLIBM: { + const VecDesc VecFuncs[] = { +#define TLI_DEFINE_AMDLIBM_VECFUNCS +#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \ + {SCAL, VEC, VF, MASK, VABI_PREFIX}, +#include "llvm/Analysis/VecFuncs.def" + }; + addVectorizableFunctions(VecFuncs); + break; + } case NoLibrary: break; } |