[libc-commits] [libc] [llvm] Reland Refactor WIDE_READ to allow finer control over high-performance function selection (#165613) (PR #170738)

Simon Tatham via libc-commits libc-commits at lists.llvm.org
Fri Dec 5 01:49:05 PST 2025


================
@@ -92,15 +92,19 @@ namespace sve {
   len += svcntp_b8(all_true, before_zero);
   return len;
 }
-} // namespace sve
+} // namespace internal::sve
 } // namespace LIBC_NAMESPACE_DECL
 #endif // LIBC_TARGET_CPU_HAS_SVE
 
 namespace LIBC_NAMESPACE_DECL {
+namespace internal::arch_vector {
+[[maybe_unused]] LIBC_INLINE size_t string_length(const char *src) {
 #ifdef LIBC_TARGET_CPU_HAS_SVE
-namespace string_length_impl = sve;
+  return sve::string_length(src);
 #elif defined(__ARM_NEON)
-namespace string_length_impl = neon;
+  return neon::string_length(src);
----------------
statham-arm wrote:

This `#if` caused a build failure for us downstream, because it doesn't have a fallback else clause, so that if you compile for the rare AArch64 targets without SVE _or_ NEON, `string_length` ends up being an empty function, provoking compiler warnings – or errors, if you build at `-Werror` – about not returning a value and not using the `src` parameter.

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


More information about the libc-commits mailing list