[libc-commits] [libc] [libc] Implement vector 'split' and 'concat' routines (PR #157537)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Wed Sep 10 13:46:19 PDT 2025
================
@@ -61,6 +57,74 @@ using simd = T [[clang::ext_vector_type(N)]];
template <typename T>
using simd_mask = simd<bool, internal::native_vector_size<T>>;
+namespace internal {
+
+template <typename T>
+using get_as_integer_type_t = unsigned _BitInt(sizeof(T) * CHAR_BIT);
+
+template <typename T> LIBC_INLINE constexpr T poison() {
+ return __builtin_nondeterministic_value(T());
+}
+
+template <typename T, size_t N, size_t OriginalSize, size_t... Indices>
+LIBC_INLINE constexpr static cpp::simd<T, sizeof...(Indices)>
+extend(cpp::simd<T, N> x, cpp::index_sequence<Indices...>) {
+ return __builtin_shufflevector(
+ x, x, (Indices < OriginalSize ? static_cast<int>(Indices) : -1)...);
+}
+
+template <typename T, size_t N, size_t TargetSize, size_t OriginalSize>
----------------
jhuber6 wrote:
Nevermind, renaming the function breaks everything because I remembered I wrote it this way on purpose. It'll just need to be confusing.
https://github.com/llvm/llvm-project/pull/157537
More information about the libc-commits
mailing list