template <class T, class A, T V0, T... Vs>
constexpr bool all_equals(batch_constant<T, A, V0, Vs...> c)
{ return (c == std::integral_constant<T, V0> {}).all();
}
template <class T, class A, T... Vs>
XSIMD_INLINE batch<T, A> bitwise_lshift_as_twice_larger(
batch<T, A> const& self, batch_constant<T, A, Vs...>) noexcept
{ using T2 = widen_t<T>;
constauto self2 = bitwise_cast<T2>(self);
// Lower byte: shift as twice the size and mask bits flowing to higher byte.
constexpr auto shifts_lo = make_batch_constant<T2, select_stride<T, 0, 2, Vs...>, A>();
constexpr auto mask_lo = lsb_mask<T2>(8 * sizeof(T)); constauto shifted_lo = bitwise_lshift(self2, shifts_lo);
constexpr auto batch_mask_lo = make_batch_constant<T2, mask_lo, A>(); constauto masked_lo = bitwise_and(shifted_lo, batch_mask_lo.as_batch());
// Higher byte: mask bits that would flow from lower byte and shift as twice the size.
constexpr auto shifts_hi = make_batch_constant<T2, select_stride<T, 1, 2, Vs...>, A>();
constexpr auto mask_hi = mask_lo << (8 * sizeof(T));
constexpr auto batch_mask_hi = make_batch_constant<T2, mask_hi, A>(); constauto masked_hi = bitwise_and(self2, batch_mask_hi.as_batch()); constauto shifted_hi = bitwise_lshift(masked_hi, shifts_hi);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.