[libc-commits] [libc] [libc] Implement generic SIMD helper 'simd.h' and implement strlen (PR #152605)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Aug 29 15:53:09 PDT 2025


================
@@ -23,14 +23,16 @@
 #include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
 
 #if defined(LIBC_COPT_STRING_UNSAFE_WIDE_READ)
-#if defined(LIBC_TARGET_ARCH_IS_X86)
+#if LIBC_HAS_VECTOR_TYPE
+#include "src/string/memory_utils/generic/inline_strlen.h"
----------------
jhuber6 wrote:

It's in a separate window, check source 1 and 2. @Sterling-Augustine already did a performance comparison before, this version doesn't change the core implementation he used https://github.com/llvm/llvm-project/pull/152389#issuecomment-3165383829. TL;DR, it's pretty much the same, very slightly slower for AVX512. I think the only difference between mine and his is that I do the unaligned load unconditionally. I could probably change that in this PR to match his if we think it's faster.

https://github.com/llvm/llvm-project/pull/152605


More information about the libc-commits mailing list