@@ -89,19 +89,19 @@ LIBC_INLINE constexpr static auto extend(cpp::simd<T, N> x) {
8989template <typename T, size_t N, size_t M, size_t ... Indices>
9090LIBC_INLINE constexpr static cpp::simd<T, N + M>
9191concat (cpp::simd<T, N> x, cpp::simd<T, M> y, cpp::index_sequence<Indices...>) {
92- constexpr size_t Length = (N > M ? N : M);
92+ constexpr size_t Size = cpp::max (N, M);
9393 auto remap = [](size_t idx) -> int {
9494 if (idx < N)
9595 return static_cast <int >(idx);
9696 if (idx < N + M)
97- return static_cast <int >((idx - N) + Length );
97+ return static_cast <int >((idx - N) + Size );
9898 return -1 ;
9999 };
100100
101101 // Extend the input vectors until they are the same size, then use the indices
102102 // to shuffle in only the indices that correspond to the original values.
103- auto x_ext = extend<T, N, Length , N>(x);
104- auto y_ext = extend<T, M, Length , M>(y);
103+ auto x_ext = extend<T, N, Size , N>(x);
104+ auto y_ext = extend<T, M, Size , M>(y);
105105 return __builtin_shufflevector (x_ext, y_ext, remap (Indices)...);
106106}
107107
0 commit comments