[llvm] [RISCV][SLEEF]: Support SLEEF vector library for RISC-V target. (PR #114014)
Mark Goncharov via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 03:14:19 PDT 2024
================
@@ -892,6 +892,155 @@ TLI_DEFINE_VECFUNC("llvm.tanh.f32", "_ZGVsMxv_tanhf", SCALABLE(4), MASKED, "_ZGV
TLI_DEFINE_VECFUNC("tgamma", "_ZGVsMxv_tgamma", SCALABLE(2), MASKED, "_ZGVsMxv")
TLI_DEFINE_VECFUNC("tgammaf", "_ZGVsMxv_tgammaf", SCALABLE(4), MASKED, "_ZGVsMxv")
+#elif defined(TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS_RISCV)
+
+TLI_DEFINE_VECFUNC("acos", "Sleef_acosdx_u10rvvm2", SCALABLE(2), NOMASK, "_ZGVvNxv")
----------------
mga-sc wrote:
Yes, ARM replaces vector functions using format "ABI_name". For this purpose, they create GNUABI support in SLEEF for AArch64 only - (look at [sleef.org support Francesco Petrogalli](https://sleef.org/) and [llvm aarch64 sleef support](https://reviews.llvm.org/D134719))
Actually, SLEEF has own function naming.
* from [funcproto.h](https://github.com/shibatch/sleef/blob/master/src/libm/funcproto.h#L41) we has info about possible precision and type.
* from [CMakeLists.txt](https://github.com/shibatch/sleef/blob/master/src/libm/CMakeLists.txt#L110) we set info about mangling name for specific architecture
* finally, [mkrename.c](https://github.com/shibatch/sleef/blob/master/src/libm/mkrename.c) use this info and in runtime rename functions.
I made the names match as in SLEEF library.
https://github.com/llvm/llvm-project/pull/114014
More information about the llvm-commits
mailing list