Bitwise Operators
per slot bitwise not |
|
per slot bitwise or |
|
per slot bitwise xor |
|
per slot bitwise and |
|
per slot bitwise and not |
|
per slot bitwise left shift |
|
per slot bitwise right shift |
|
per slot rotate right |
|
per slot rotate left |
|
unsigned integral types only; per slot population count, returned as the same unsigned type |
-
template<class T, class A>
inline batch<T, A> bitwise_and(batch<T, A> const &x, batch<T, A> const &y) noexcept Computes the bitwise and of the batches
xandy.- Parameters:
x – batch involved in the operation.
y – batch involved in the operation.
- Returns:
the result of the bitwise and.
-
template<class T, class A>
inline batch_bool<T, A> bitwise_and(batch_bool<T, A> const &x, batch_bool<T, A> const &y) noexcept Computes the bitwise and of the batches
xandy.- Parameters:
x – batch involved in the operation.
y – batch involved in the operation.
- Returns:
the result of the bitwise and.
-
template<class T, class A>
inline batch<T, A> bitwise_andnot(batch<T, A> const &x, batch<T, A> const &y) noexcept Computes the bitwise and not of batches
xandy.- Parameters:
x – batch involved in the operation.
y – batch involved in the operation.
- Returns:
the result of the bitwise and not.
-
template<class T, class A>
inline batch<T, A> bitwise_lshift(batch<T, A> const &x, int shift) noexcept Perform a bitwise shift to the left.
- Parameters:
x – batch of
T_inshift – scalar amount to shift
- Returns:
shifted
x.
-
template<class T, class A>
inline batch<T, A> bitwise_not(batch<T, A> const &x) noexcept Computes the bitwise not of batch
x.- Parameters:
x – batch involved in the operation.
- Returns:
the result of the bitwise not.
-
template<class T, class A>
inline batch_bool<T, A> bitwise_not(batch_bool<T, A> const &x) noexcept Computes the bitwise not of batch
x.- Parameters:
x – batch involved in the operation.
- Returns:
the result of the bitwise not.
-
template<class T, class A>
inline batch<T, A> bitwise_or(batch<T, A> const &x, batch<T, A> const &y) noexcept Computes the bitwise or of the batches
xandy.- Parameters:
x – scalar or batch of scalars
y – scalar or batch of scalars
- Returns:
the result of the bitwise or.
-
template<class T, class A>
inline batch_bool<T, A> bitwise_or(batch_bool<T, A> const &x, batch_bool<T, A> const &y) noexcept Computes the bitwise or of the batches
xandy.- Parameters:
x – scalar or batch of scalars
y – scalar or batch of scalars
- Returns:
the result of the bitwise or.
-
template<class T, class A>
inline batch<T, A> bitwise_rshift(batch<T, A> const &x, int shift) noexcept Perform a bitwise shift to the right.
- Parameters:
x – batch of
T_inshift – scalar amount to shift
- Returns:
shifted
x.
-
template<class T, class A>
inline batch<T, A> bitwise_xor(batch<T, A> const &x, batch<T, A> const &y) noexcept Computes the bitwise xor of the batches
xandy.- Parameters:
x – scalar or batch of scalars
y – scalar or batch of scalars
- Returns:
the result of the bitwise xor.
-
template<class T, class A>
inline batch_bool<T, A> bitwise_xor(batch_bool<T, A> const &x, batch_bool<T, A> const &y) noexcept Computes the bitwise xor of the batches
xandy.- Parameters:
x – scalar or batch of scalars
y – scalar or batch of scalars
- Returns:
the result of the bitwise xor.
-
template<class T, class A>
inline batch<T, A> popcount(batch<T, A> const &x) noexcept Counts the bits set in each element of
x.- Parameters:
x – batch of unsigned integer values.
- Returns:
per slot population count.
-
template<class T, class A>
inline batch<T, A> rotl(batch<T, A> const &x, int shift) noexcept Perform a bitwise shift to the left, reintroducing the shifted out bits to the right.
The shift is reduced modulo the number of bits of an element.
- Parameters:
x – batch to rotate
shift – scalar amount to shift
- Returns:
rotated
x.
-
template<class T, class A>
inline batch<T, A> rotr(batch<T, A> const &x, int shift) noexcept Perform a bitwise shift to the right, reintroducing the shifted out bits to the left.
The shift is reduced modulo the number of bits of an element.
- Parameters:
x – batch to rotate
shift – scalar amount to shift
- Returns:
rotated
x.