You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harmonize constant batch type signature with non constant batch
batch<T, A> <> batch_constant<T, A, Csts...>
batch_bool<T, A> <> batch_bool_constant<T, A, Csts...>
This is a strong API (and ABI) change, but it makes the type system more
harmonious.
returnselect(batch_bool_constant<batch<T, A>, (Indices < bsize)...>(), x, y);
485
+
returnselect(batch_bool_constant<T, A, (Indices < bsize)...>(), x, y);
486
486
}
487
487
488
488
#if defined(__has_builtin)
@@ -503,9 +503,9 @@ namespace xsimd
503
503
#else
504
504
// Use a generic_pattern. It is suboptimal but clang optimizes this
505
505
// pretty well.
506
-
batch<T, A> x_lane = swizzle(x, batch_constant<batch<ITy, A>, ((Indices >= bsize) ? (Indices - bsize) : Indices)...>());
507
-
batch<T, A> y_lane = swizzle(y, batch_constant<batch<ITy, A>, ((Indices >= bsize) ? (Indices - bsize) : Indices)...>());
508
-
batch_bool_constant<batch<T, A>, (Indices < bsize)...> select_x_lane;
506
+
batch<T, A> x_lane = swizzle(x, batch_constant<ITy, A, ((Indices >= bsize) ? (Indices - bsize) : Indices)...>());
507
+
batch<T, A> y_lane = swizzle(y, batch_constant<ITy, A, ((Indices >= bsize) ? (Indices - bsize) : Indices)...>());
508
+
batch_bool_constant<T, A, (Indices < bsize)...> select_x_lane;
509
509
returnselect(select_x_lane, x_lane, y_lane);
510
510
#endif
511
511
}
@@ -542,7 +542,7 @@ namespace xsimd
542
542
543
543
// swizzle
544
544
template <classA, classT, classITy, ITy... Vs>
545
-
inline batch<std::complex<T>, A> swizzle(batch<std::complex<T>, A> const& self, batch_constant<batch<ITy, A>, Vs...> mask, requires_arch<generic>) noexcept
545
+
inline batch<std::complex<T>, A> swizzle(batch<std::complex<T>, A> const& self, batch_constant<ITy, A, Vs...> mask, requires_arch<generic>) noexcept
Copy file name to clipboardExpand all lines: include/xsimd/arch/xsimd_avx.hpp
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1161,22 +1161,22 @@ namespace xsimd
1161
1161
returndetail::merge_sse(res_low, res_hi);
1162
1162
}
1163
1163
template <classA, classT, bool... Values, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
1164
-
inline batch<T, A> select(batch_bool_constant<batch<T, A>, Values...> const&, batch<T, A> const& true_br, batch<T, A> const& false_br, requires_arch<avx>) noexcept
1164
+
inline batch<T, A> select(batch_bool_constant<T, A, Values...> const&, batch<T, A> const& true_br, batch<T, A> const& false_br, requires_arch<avx>) noexcept
1165
1165
{
1166
1166
returnselect(batch_bool<T, A> { Values... }, true_br, false_br, avx2 {});
1167
1167
}
1168
1168
1169
1169
template <classA, bool... Values>
1170
-
inline batch<float, A> select(batch_bool_constant<batch<float, A>, Values...> const&, batch<float, A> const& true_br, batch<float, A> const& false_br, requires_arch<avx>) noexcept
1170
+
inline batch<float, A> select(batch_bool_constant<float, A, Values...> const&, batch<float, A> const& true_br, batch<float, A> const& false_br, requires_arch<avx>) noexcept
1171
1171
{
1172
-
constexprauto mask = batch_bool_constant<batch<float, A>, Values...>::mask();
1172
+
constexprauto mask = batch_bool_constant<float, A, Values...>::mask();
1173
1173
return_mm256_blend_ps(false_br, true_br, mask);
1174
1174
}
1175
1175
1176
1176
template <classA, bool... Values>
1177
-
inline batch<double, A> select(batch_bool_constant<batch<double, A>, Values...> const&, batch<double, A> const& true_br, batch<double, A> const& false_br, requires_arch<avx>) noexcept
1177
+
inline batch<double, A> select(batch_bool_constant<double, A, Values...> const&, batch<double, A> const& true_br, batch<double, A> const& false_br, requires_arch<avx>) noexcept
1178
1178
{
1179
-
constexprauto mask = batch_bool_constant<batch<double, A>, Values...>::mask();
1179
+
constexprauto mask = batch_bool_constant<double, A, Values...>::mask();
inline batch<float, A> shuffle(batch<float, A> const& x, batch<float, A> const& y, batch_constant<batch<ITy, A>, I0, I1, I2, I3, I4, I5, I6, I7> mask, requires_arch<avx>) noexcept
1241
+
inline batch<float, A> shuffle(batch<float, A> const& x, batch<float, A> const& y, batch_constant<ITy, A, I0, I1, I2, I3, I4, I5, I6, I7> mask, requires_arch<avx>) noexcept
inline batch<double, A> shuffle(batch<double, A> const& x, batch<double, A> const& y, batch_constant<batch<ITy, A>, I0, I1, I2, I3> mask, requires_arch<avx>) noexcept
1256
+
inline batch<double, A> shuffle(batch<double, A> const& x, batch<double, A> const& y, batch_constant<ITy, A, I0, I1, I2, I3> mask, requires_arch<avx>) noexcept
Copy file name to clipboardExpand all lines: include/xsimd/arch/xsimd_avx2.hpp
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -729,9 +729,9 @@ namespace xsimd
729
729
}
730
730
}
731
731
template <classA, classT, bool... Values, class = typename std::enable_if<std::is_integral<T>::value, void>::type>
732
-
inline batch<T, A> select(batch_bool_constant<batch<T, A>, Values...> const&, batch<T, A> const& true_br, batch<T, A> const& false_br, requires_arch<avx2>) noexcept
732
+
inline batch<T, A> select(batch_bool_constant<T, A, Values...> const&, batch<T, A> const& true_br, batch<T, A> const& false_br, requires_arch<avx2>) noexcept
733
733
{
734
-
constexprint mask = batch_bool_constant<batch<T, A>, Values...>::mask();
734
+
constexprint mask = batch_bool_constant<T, A, Values...>::mask();
735
735
// FIXME: for some reason mask here is not considered as an immediate,
736
736
// but it's okay for _mm256_blend_epi32
737
737
// case 2: return _mm256_blend_epi16(false_br, true_br, mask);
0 commit comments