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 and |
|
per slot bitwise and not |
|
per slot rotate right |
|
per slot rotate left |
-
template<class T, class A>
XSIMD_INLINE auto bitwise_and(batch<T, A> const &x, batch<T, A> const &y) noexcept -> decltype(x & y) Computes the bitwise and of the batches
x
andy
.- 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>
XSIMD_INLINE auto bitwise_and(batch_bool<T, A> const &x, batch_bool<T, A> const &y) noexcept -> decltype(x & y) Computes the bitwise and of the batches
x
andy
.- 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> XSIMD_INLINE batch< T, A > bitwise_andnot (batch< T, A > const &x, batch< T, A > const &y) noexcept
Computes the bitwise and not of batches
x
andy
.- 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> XSIMD_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_in
shift – scalar amount to shift
- Returns:
shifted
x
.
- template<class T, class A> XSIMD_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> XSIMD_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>
XSIMD_INLINE auto bitwise_or(batch<T, A> const &x, batch<T, A> const &y) noexcept -> decltype(x | y) Computes the bitwise or of the batches
x
andy
.- 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>
XSIMD_INLINE auto bitwise_or(batch_bool<T, A> const &x, batch_bool<T, A> const &y) noexcept -> decltype(x | y) Computes the bitwise or of the batches
x
andy
.- 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> XSIMD_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_in
shift – scalar amount to shift
- Returns:
shifted
x
.
-
template<class T, class A>
XSIMD_INLINE auto bitwise_xor(batch<T, A> const &x, batch<T, A> const &y) noexcept -> decltype(x ^ y) Computes the bitwise xor of the batches
x
andy
.- 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>
XSIMD_INLINE auto bitwise_xor(batch_bool<T, A> const &x, batch_bool<T, A> const &y) noexcept -> decltype(x ^ y) Computes the bitwise xor of the batches
x
andy
.- 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> XSIMD_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.
- Parameters:
x – batch to rotate
shift – scalar amount to shift
- Returns:
rotated
x
.
- template<class T, class A> XSIMD_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.
- Parameters:
x – batch to rotate
shift – scalar amount to shift
- Returns:
rotated
x
.