[libc] [llvm] Add vector-based strlen implementation for x86_64 and aarch64 (PR #152389)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 7 14:03:51 PDT 2025
lntue wrote:
> Is it possible to do this with the [LLVM/GCC vector types](https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors) instead? It doesn't look like we're doing anything terribly complicated so it might get the same performance while being more cross-platform.
I would prefer to have somewhat generic version like this in first so that it works for older versions of clang/gcc. This is also similar to what we have for `inline_memcpy`. It can be used as a backup for older vectors where compiler builtin vector types do not work.
The builtin LLVM/GCC vector types are still evolving, and to use them effectively, we will need a somewhat recent version of clang. It will take some work to have portable vector classes that work for some older compiler versions. libmvec work will also need one, so I think we should unify the work for an internal portable template vector class. And once it's ready, we can use it to simplify the implementation while making sure there is no regression with the performance tests in place.
https://github.com/llvm/llvm-project/pull/152389
More information about the llvm-commits
mailing list