[llvm] [AArch64][VecLib] Add vector function mappings for the modf, sincos, sincospi vector intrinsics (PR #175098)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 9 02:18:46 PST 2026
================
@@ -1548,6 +1548,11 @@ TLI_DEFINE_VECFUNC("modff", "armpl_vmodfq_f32", FIXED(4), NOMASK, "_ZGV_LLVM_N4v
TLI_DEFINE_VECFUNC("modf", "armpl_svmodf_f64_x", SCALABLE(2), MASKED, "_ZGVsMxvl8", NOCC)
TLI_DEFINE_VECFUNC("modff", "armpl_svmodf_f32_x", SCALABLE(4), MASKED, "_ZGVsMxvl4", NOCC)
+TLI_DEFINE_VECFUNC("llvm.modf.f64", "armpl_vmodfq_f64_stret", FIXED(2), NOMASK, "_ZGV_LLVM_N2v", CallingConv::AArch64_VectorCall)
+TLI_DEFINE_VECFUNC("llvm.modf.f32", "armpl_vmodfq_f32_stret", FIXED(4), NOMASK, "_ZGV_LLVM_N4v", CallingConv::AArch64_VectorCall)
+TLI_DEFINE_VECFUNC("llvm.modf.f64", "armpl_svmodf_f64_stret_x", SCALABLE(2), MASKED, "_ZGVsMxv", NOCC)
+TLI_DEFINE_VECFUNC("llvm.modf.f32", "armpl_svmodf_f32_stret_x", SCALABLE(4), MASKED, "_ZGVsMxv", NOCC)
----------------
MacDue wrote:
I don't know if this is really an issue in practice, but the AArch64 VFABI does not support this kind of mapping. If you look at the RGB example: https://github.com/ARM-software/abi-aa/blob/main/vfabia64/vfabia64.rst#rgb-example
You see if we were to follow the VFABI the struct result should be returned using an output parameter (which is a vector of pointers). Obviously, this is not what we want, but it's something we noticed when looking at this in the past, and thought might need amending before libraries provided these functions.
https://github.com/llvm/llvm-project/pull/175098
More information about the llvm-commits
mailing list