[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 12:36:42 PDT 2025


================
@@ -0,0 +1,113 @@
+//===-- Strlen implementation for x86_64 ----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_STRLEN_H
+#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_STRLEN_H
+
+#include "src/string/memory_utils/op_x86.h" // K_AVX
+
+#include <stddef.h> // size_t
+#include <x86intrin.h>
----------------
lntue wrote:

I don't think `x86intrin.h` header is portable.  `memory_utils/op_x86.h` already has `immintrin.h` included: https://github.com/llvm/llvm-project/blob/main/libc/src/string/memory_utils/op_x86.h#L27

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


More information about the llvm-commits mailing list