[libc-commits] [libc] [libc] Implement wide read strlen with LLVM vector type (PR #152605)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Sun Aug 10 20:52:06 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
----------------
jhuber6 wrote:
It's inside the `get_bitmask` utility, we convert the `-1` comparison mask to a bool vector and then bitcast it to a integer mask we use `ctz` on. Is there a more idiomatic check for bool vectors?
https://github.com/llvm/llvm-project/pull/152605
More information about the libc-commits
mailing list