[libc-commits] [libc] [libc] Implement wide read strlen with LLVM vector type (PR #152605)

Matt Arsenault via libc-commits libc-commits at lists.llvm.org
Sat Aug 9 19:15:39 PDT 2025


================
@@ -48,4 +48,13 @@
 #define LIBC_PREFERED_TYPE(TYPE)
 #endif
 
+#if __has_attribute(ext_vector_type) && defined(__clang__) &&                  \
+    __clang_major__ >= 15 &&                                                   \
+    (defined(LIBC_TARGET_ARCH_IS_X86) || defined(LIBC_TARGET_ARCH_IS_ARM))
+#define LIBC_HAS_VECTOR_TYPE 1
+#define LIBC_VECTOR_TYPE(N) __attribute__((ext_vector_type(N)))
+#else
+#define LIBC_HAS_VECTOR_TYPE 0
+#endif
----------------
arsenm wrote:

I don't exactly follow this condition. __has_attribute(ext_vector_type) should be all you need for a "has vector type". I would separate out the profitability concern 

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


More information about the libc-commits mailing list