@@ -166,43 +166,6 @@ namespace xsimd
166166 XSIMD_INLINE constexpr bool is_cross_lane (batch_constant<T, A, Vs...>) noexcept { return detail::is_cross_lane<Vs...>(); }
167167 template <typename T, class A , T... Vs>
168168 XSIMD_INLINE constexpr bool no_duplicates (batch_constant<T, A, Vs...>) noexcept { return no_duplicates_impl<0 , sizeof ...(Vs), T, Vs...>(); }
169- // ────────────────────────────────────────────────────────────────────────
170- // compile-time tests (identity, all-different, dup-lo, dup-hi)
171- // 8-lane identity
172- static_assert (is_identity<std::uint32_t , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 >(), " identity failed" );
173- // 8-lane reverse is all-different but not identity
174- static_assert (is_all_different<std::uint32_t , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 >(), " all-diff failed" );
175- static_assert (!is_identity<std::uint32_t , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 >(), " identity on reverse" );
176- // 8-lane dup-lo (repeat 0..3 twice)
177- static_assert (is_dup_lo<std::uint32_t , 0 , 1 , 2 , 3 , 0 , 1 , 2 , 3 >(), " dup_lo failed" );
178- static_assert (!is_dup_hi<std::uint32_t , 0 , 1 , 2 , 3 , 0 , 1 , 2 , 3 >(), " dup_hi on dup_lo" );
179- // 8-lane dup-hi (repeat 4..7 twice)
180- static_assert (is_dup_hi<std::uint32_t , 4 , 5 , 6 , 7 , 4 , 5 , 6 , 7 >(), " dup_hi failed" );
181- static_assert (!is_dup_lo<std::uint32_t , 4 , 5 , 6 , 7 , 4 , 5 , 6 , 7 >(), " dup_lo on dup_hi" );
182- // ────────────────────────────────────────────────────────────────────────
183- // 4-lane identity
184- static_assert (is_identity<std::uint32_t , 0 , 1 , 2 , 3 >(), " 4-lane identity failed" );
185- // 4-lane reverse all-different but not identity
186- static_assert (is_all_different<std::uint32_t , 3 , 2 , 1 , 0 >(), " 4-lane all-diff failed" );
187- static_assert (!is_identity<std::uint32_t , 3 , 2 , 1 , 0 >(), " 4-lane identity on reverse" );
188- // 4-lane dup-lo (repeat 0..1 twice)
189- static_assert (is_dup_lo<std::uint32_t , 0 , 1 , 0 , 1 >(), " 4-lane dup_lo failed" );
190- static_assert (!is_dup_hi<std::uint32_t , 0 , 1 , 0 , 1 >(), " 4-lane dup_hi on dup_lo" );
191- // 4-lane dup-hi (repeat 2..3 twice)
192- static_assert (is_dup_hi<std::uint32_t , 2 , 3 , 2 , 3 >(), " 4-lane dup_hi failed" );
193- static_assert (!is_dup_lo<std::uint32_t , 2 , 3 , 2 , 3 >(), " 4-lane dup_lo on dup_hi" );
194-
195- static_assert (is_cross_lane<0 , 1 , 0 , 1 >(), " dup-lo only → crossing" );
196- static_assert (is_cross_lane<2 , 3 , 2 , 3 >(), " dup-hi only → crossing" );
197- static_assert (is_cross_lane<0 , 3 , 3 , 3 >(), " one low + rest high → crossing" );
198- static_assert (!is_cross_lane<1 , 0 , 2 , 3 >(), " mixed low/high → no crossing" );
199- static_assert (!is_cross_lane<0 , 1 , 2 , 3 >(), " mixed low/high → no crossing" );
200-
201- static_assert (no_duplicates_v<0 , 1 , 2 , 3 >(), " N=4: [0,1,2,3] → distinct" );
202- static_assert (!no_duplicates_v<0 , 1 , 2 , 2 >(), " N=4: [0,1,2,2] → dup" );
203-
204- static_assert (no_duplicates_v<0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 >(), " N=8: [0..7] → distinct" );
205- static_assert (!no_duplicates_v<0 , 1 , 2 , 3 , 4 , 5 , 6 , 0 >(), " N=8: last repeats 0" );
206169
207170 } // namespace detail
208171 } // namespace kernel
0 commit comments