Skip to content

Commit d99d88e

Browse files
committed
Remove no_duplicates
1 parent f54a606 commit d99d88e

File tree

3 files changed

+3
-37
lines changed

3 files changed

+3
-37
lines changed

include/xsimd/arch/common/xsimd_common_swizzle.hpp

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace xsimd
3939
};
4040

4141
// ────────────────────────────────────────────────────────────────────────
42-
// 1) identity_impl
42+
// identity_impl
4343
template <std::size_t /*I*/, typename T>
4444
XSIMD_INLINE constexpr bool identity_impl() noexcept { return true; }
4545
template <std::size_t I, typename T, T V0, T... Vs>
@@ -50,18 +50,7 @@ namespace xsimd
5050
}
5151

5252
// ────────────────────────────────────────────────────────────────────────
53-
// 2) bitmask_impl
54-
template <std::size_t /*I*/, std::size_t /*N*/, typename T>
55-
XSIMD_INLINE constexpr std::uint32_t bitmask_impl() noexcept { return 0u; }
56-
template <std::size_t I, std::size_t N, typename T, T V0, T... Vs>
57-
XSIMD_INLINE constexpr std::uint32_t bitmask_impl() noexcept
58-
{
59-
return (1u << (static_cast<std::uint32_t>(V0) & (N - 1)))
60-
| bitmask_impl<I + 1, N, T, Vs...>();
61-
}
62-
63-
// ────────────────────────────────────────────────────────────────────────
64-
// 3) dup_lo_impl
53+
// dup_lo_impl
6554
template <std::size_t I, std::size_t N, typename T,
6655
T... Vs, typename std::enable_if<I == N / 2, int>::type = 0>
6756
XSIMD_INLINE constexpr bool dup_lo_impl() noexcept { return true; }
@@ -76,7 +65,7 @@ namespace xsimd
7665
}
7766

7867
// ────────────────────────────────────────────────────────────────────────
79-
// 4) dup_hi_impl
68+
// dup_hi_impl
8069
template <std::size_t I, std::size_t N, typename T,
8170
T... Vs, typename std::enable_if<I == N / 2, int>::type = 0>
8271
XSIMD_INLINE constexpr bool dup_hi_impl() noexcept { return true; }
@@ -123,19 +112,6 @@ namespace xsimd
123112
{
124113
static constexpr bool value = false;
125114
};
126-
template <std::size_t I, std::size_t N, typename T,
127-
T... Vs>
128-
XSIMD_INLINE constexpr bool no_duplicates_impl() noexcept
129-
{
130-
// build the bitmask of (Vs & (N-1)) across all lanes
131-
return detail::bitmask_impl<0, N, T, Vs...>() == ((1u << N) - 1u);
132-
}
133-
template <uint32_t... Vs>
134-
XSIMD_INLINE constexpr bool no_duplicates_v() noexcept
135-
{
136-
// forward to your existing no_duplicates_impl
137-
return no_duplicates_impl<0, sizeof...(Vs), uint32_t, Vs...>();
138-
}
139115
template <uint32_t... Vs>
140116
XSIMD_INLINE constexpr bool is_cross_lane() noexcept
141117
{
@@ -156,8 +132,6 @@ namespace xsimd
156132
XSIMD_INLINE constexpr bool is_dup_hi(batch_constant<T, A, Vs...>) noexcept { return is_dup_hi<T, Vs...>(); }
157133
template <typename T, class A, T... Vs>
158134
XSIMD_INLINE constexpr bool is_cross_lane(batch_constant<T, A, Vs...>) noexcept { return detail::is_cross_lane<Vs...>(); }
159-
template <typename T, class A, T... Vs>
160-
XSIMD_INLINE constexpr bool no_duplicates(batch_constant<T, A, Vs...>) noexcept { return no_duplicates_impl<0, sizeof...(Vs), T, Vs...>(); }
161135

162136
} // namespace detail
163137
} // namespace kernel

include/xsimd/arch/xsimd_common_fwd.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ namespace xsimd
6565
XSIMD_INLINE constexpr bool is_dup_hi(batch_constant<T, A, Vs...>) noexcept;
6666
template <typename T, class A, T... Vs>
6767
XSIMD_INLINE constexpr bool is_cross_lane(batch_constant<T, A, Vs...>) noexcept;
68-
template <typename T, class A, T... Vs>
69-
XSIMD_INLINE constexpr bool no_duplicates(batch_constant<T, A, Vs...>) noexcept;
7068

7169
}
7270
}

test/test_batch_manip.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ namespace xsimd
5151
static_assert(is_cross_lane<0, 3, 3, 3>(), "one low + rest high → crossing");
5252
static_assert(!is_cross_lane<1, 0, 2, 3>(), "mixed low/high → no crossing");
5353
static_assert(!is_cross_lane<0, 1, 2, 3>(), "mixed low/high → no crossing");
54-
55-
static_assert(no_duplicates_v<0, 1, 2, 3>(), "N=4: [0,1,2,3] → distinct");
56-
static_assert(!no_duplicates_v<0, 1, 2, 2>(), "N=4: [0,1,2,2] → dup");
57-
58-
static_assert(no_duplicates_v<0, 1, 2, 3, 4, 5, 6, 7>(), "N=8: [0..7] → distinct");
59-
static_assert(!no_duplicates_v<0, 1, 2, 3, 4, 5, 6, 0>(), "N=8: last repeats 0");
6054
}
6155
}
6256
}

0 commit comments

Comments
 (0)