Bitwise operatorsΒΆ

bitwise_not()

per slot bitwise not

bitwise_or()

per slot bitwise or

bitwise_xor()

per slot bitwise xor

bitwise_and()

per slot bitwise and

bitwise_andnot()

per slot bitwise and not

bitwise_lshift()

per slot bitwise and

bitwise_rshift()

per slot bitwise and not

rotr()

per slot rotate right

rotl()

per slot rotate left


template <class T, class A>
XSIMD_INLINE auto xsimd::bitwise_and(batch< T, A > const & x, batch< T, A > const & y)

Computes the bitwise and of the batches x and y.

Return

the result of the bitwise and.

Parameters
  • x: batch involved in the operation.

  • y: batch involved in the operation.

template <class T, class A>
XSIMD_INLINE auto xsimd::bitwise_and(batch_bool< T, A > const & x, batch_bool< T, A > const & y)

Computes the bitwise and of the batches x and y.

Return

the result of the bitwise and.

Parameters
  • x: batch involved in the operation.

  • y: batch involved in the operation.

template <class T, class A>
XSIMD_INLINE batch<T, A> xsimd::bitwise_andnot(batch< T, A > const & x, batch< T, A > const & y)

Computes the bitwise and not of batches x and y.

Return

the result of the bitwise and not.

Parameters
  • x: batch involved in the operation.

  • y: batch involved in the operation.

template <class T, class A>
XSIMD_INLINE batch<T, A> xsimd::bitwise_lshift(batch< T, A > const & x, int shift)

Perform a bitwise shift to the left.

Return

shifted x.

Parameters
  • x: batch of T_in

  • shift: scalar amount to shift

template <class T, class A>
XSIMD_INLINE batch<T, A> xsimd::bitwise_not(batch< T, A > const & x)

Computes the bitwise not of batch x.

Return

the result of the bitwise not.

Parameters
  • x: batch involved in the operation.

template <class T, class A>
XSIMD_INLINE batch_bool<T, A> xsimd::bitwise_not(batch_bool< T, A > const & x)

Computes the bitwise not of batch x.

Return

the result of the bitwise not.

Parameters
  • x: batch involved in the operation.

template <class T, class A>
XSIMD_INLINE auto xsimd::bitwise_or(batch< T, A > const & x, batch< T, A > const & y)

Computes the bitwise or of the batches x and y.

Return

the result of the bitwise or.

Parameters
  • x: scalar or batch of scalars

  • y: scalar or batch of scalars

template <class T, class A>
XSIMD_INLINE auto xsimd::bitwise_or(batch_bool< T, A > const & x, batch_bool< T, A > const & y)

Computes the bitwise or of the batches x and y.

Return

the result of the bitwise or.

Parameters
  • x: scalar or batch of scalars

  • y: scalar or batch of scalars

template <class T, class A>
XSIMD_INLINE batch<T, A> xsimd::bitwise_rshift(batch< T, A > const & x, int shift)

Perform a bitwise shift to the right.

Return

shifted x.

Parameters
  • x: batch of T_in

  • shift: scalar amount to shift

template <class T, class A>
XSIMD_INLINE auto xsimd::bitwise_xor(batch< T, A > const & x, batch< T, A > const & y)

Computes the bitwise xor of the batches x and y.

Return

the result of the bitwise xor.

Parameters
  • x: scalar or batch of scalars

  • y: scalar or batch of scalars

template <class T, class A>
XSIMD_INLINE auto xsimd::bitwise_xor(batch_bool< T, A > const & x, batch_bool< T, A > const & y)

Computes the bitwise xor of the batches x and y.

Return

the result of the bitwise xor.

Parameters
  • x: scalar or batch of scalars

  • y: scalar or batch of scalars

template <class T, class A>
XSIMD_INLINE batch<T, A> xsimd::rotl(batch< T, A > const & x, int shift)

Perform a bitwise shift to the left, reintroducing the shifted out bits to the right.

Return

rotated x.

Parameters
  • x: batch to rotate

  • shift: scalar amount to shift

template <class T, class A>
XSIMD_INLINE batch<T, A> xsimd::rotr(batch< T, A > const & x, int shift)

Perform a bitwise shift to the right, reintroducing the shifted out bits to the left.

Return

rotated x.

Parameters
  • x: batch to rotate

  • shift: scalar amount to shift