[libc-commits] [libc] Include inline_strlen.h on aarch64 only if the target has vector instrucions (PR #170892)
via libc-commits
libc-commits at lists.llvm.org
Fri Dec 5 09:48:13 PST 2025
https://github.com/Sterling-Augustine created https://github.com/llvm/llvm-project/pull/170892
None
>From 95a7c60023b74603f90f1d0f7767f340ca125643 Mon Sep 17 00:00:00 2001
From: Sterling Augustine <saugustine at google.com>
Date: Fri, 5 Dec 2025 09:46:11 -0800
Subject: [PATCH] Only include inline_strlen.h on aarch64 if the target has
vector instructions.
---
libc/src/string/string_length.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/string/string_length.h b/libc/src/string/string_length.h
index c828c85c16a17..1dc59d0078079 100644
--- a/libc/src/string/string_length.h
+++ b/libc/src/string/string_length.h
@@ -24,7 +24,7 @@
#endif
#if defined(LIBC_TARGET_ARCH_IS_X86)
#include "src/string/memory_utils/x86_64/inline_strlen.h"
-#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
+#elif defined(LIBC_TARGET_ARCH_IS_AARCH64) && (defined(LIBC_TARGET_CPU_HAS_SVE) || defined(__ARM_NEON))
#include "src/string/memory_utils/aarch64/inline_strlen.h"
#endif
More information about the libc-commits
mailing list