[llvm] RuntimeLibcalls: Add definitions for vector math functions (PR #167026)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 24 10:02:49 PST 2025
================
@@ -182,10 +182,63 @@ foreach FPTy = ["F32", "F64", "F80", "F128", "PPCF128"] in {
def MODF_#FPTy : RuntimeLibcall;
}
-foreach VecTy = ["V4F32", "V2F64", "NXV4F32", "NXV2F64"] in {
- def MODF_#VecTy : RuntimeLibcall;
- def SINCOS_#VecTy : RuntimeLibcall;
- def SINCOSPI_#VecTy : RuntimeLibcall;
+defvar F32VectorSuffixes = ["V2F32", "V4F32", "V8F32", "V16F32", "NXV4F32"];
+defvar F64VectorSuffixes = ["V2F64", "V4F64", "V8F64", "NXV2F64"];
----------------
arsenm wrote:
Merging this is pretty far off. I'm gradually turning RuntimeLibcallsInfo into a replacement for TargetLibraryInfo.
Eventually this should all be in one consistent tablegen description for the function type. VecFuncs doesn't directly record its full type signature, just an element count and the mask, and you have to look up the vector call from the base scalar call (which doesn't always exist).
c9f573463ebd7b4e46da4877802f2364f700e54a moved TargetLibraryInfo's C-flavored type information into tablegen, so hopefully I can build something off of that. For the codegen usage, we need the type information as an IR signature, with the lowered C-ABI for all of the real functions we have today.
I'm only manually implementing the type information a handful of cases, because some of them are useful for concrete problems in codegen (e.g., I needed this to consolidate the sincos_stret handling across AArch64, ARM and X86), and some others for a sample of what the code tablegen will need to look like. hasVectorMaskArgument is only an implementation detail of the manually written type information. It only needs to be correct for anything manually handled
https://github.com/llvm/llvm-project/pull/167026
More information about the llvm-commits
mailing list