[llvm-branch-commits] [libc] [libc] Add optimized clang_vector memchr implementation (PR #244469)
Aiden Grossman via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Nov 20 11:04:34 PST 2026
================
@@ -55,39 +55,168 @@ LIBC_INLINE static const void *calculate_find_first_character_return(
return src + c_offset;
}
-LIBC_NO_SANITIZE_OOB_ACCESS LIBC_INLINE static const void *
+LIBC_INLINE_VAR constexpr size_t VEC_SIZE = sizeof(cpp::simd<char>);
+LIBC_INLINE_VAR constexpr size_t LOOP_BLOCK_SIZE = 4 * VEC_SIZE;
+
+// A find_first_character implementation for inputs less than the loop block
+// size. It loads N vectors with the last end of the last vector alinging
+// with the end of the buffer passed in.
+template <size_t N>
----------------
boomanaiden154 wrote:
Good point. Renamed to `VecN`.
https://github.com/llvm/llvm-project/pull/244469
More information about the llvm-branch-commits
mailing list