[clang] [llvm] [RFC][MATHVEC] Introduce the LLVM's mathvec library as yet another veclib functions provider (PR #234621)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 22 08:06:49 PDT 2026
Andarwinux wrote:
As a veclib user, I hope this can be more integrated with the LLVM/Clang toolchain and coexist with -fveclib.
- mathvec should be part of compiler-rt builtins, distributed with the toolchain, and enabled by default (via such as -fuse-mathvec-builtin?), so users only need to add -fno-math-errno to vectorize all math functions. And then could specify -fveclib to prefer to use other veclibs and with mathvec as a fallback.
- mathvec shouldn't follow libmvec's symbol name mangling and calling convention to pretend to be a clone of libmvec.
- As a portable vector math library based on llvm-libc, mathvec is supposed to support multiple target arch - but what if there are target arches unsupported by libmvec?
- mathvec is supposed to support multiple target OS other than Linux such as Windows.
- It might be best to use some custom calling convention to improve performance. For example, on Windows, __m256 and __m512 are passed via stack unless use vectorcall.
https://github.com/llvm/llvm-project/pull/234621
More information about the cfe-commits
mailing list