Skip to content

Commit 7119e9a

Browse files
AntoinePrvpitrou
andauthored
Apply suggestions from code review
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
1 parent cde846f commit 7119e9a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

include/xsimd/arch/xsimd_avx2.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,16 @@ namespace xsimd
333333
}
334334
}
335335

336-
// bitwise_lshift multiple (constant) specific implementations.
336+
// bitwise_lshift with constant bitshifts, for 16-bit elements.
337337
// Missing implementations are dispacthed to the `batch` overload in xsimd_api.
338338
template <class T, class A, T... Vs, detail::enable_sized_integral_t<T, 2> = 0>
339339
XSIMD_INLINE batch<T, A> bitwise_lshift(
340340
batch<T, A> const& self, batch_constant<T, A, Vs...> shifts, requires_arch<avx2> req) noexcept
341341
{
342342
using uint_t = typename std::make_unsigned<T>::type;
343343

344+
// AVX2 only supports 16-bit shifts with a uniform bitshift value,
345+
// otherwise emulate using 32-bit shifts.
344346
XSIMD_IF_CONSTEXPR(utils::all_equals(shifts))
345347
{
346348
return bitwise_lshift<shifts.get(0), A>(self, req);
@@ -351,6 +353,7 @@ namespace xsimd
351353
batch_constant<uint_t, A, static_cast<uint_t>(Vs)...> {}));
352354
}
353355

356+
// bitwise_lshift with constant bitshifts, for 8-bit elements.
354357
template <class T, class A, T... Vs, detail::enable_sized_integral_t<T, 1> = 0>
355358
XSIMD_INLINE batch<T, A> bitwise_lshift(
356359
batch<T, A> const& self, batch_constant<T, A, Vs...> shifts, requires_arch<avx2> req) noexcept

0 commit comments

Comments
 (0)