simdpp::shift_r(vector)
| template<unsigned N, class E1, class E2>
Ret<N, _DETAIL_> shift_r( const Vec1<N,E1>& a, const Vec2<N,E2>& b ); |
||
Shifts values in the given integer vector a right by the number of bits specified in the corresponding elements of the given integer vector b. Zeroes are shifted in for unsigned vectors, sign bits is shifted in for signed vectors.
The implementation behaves as if the following set of overloads is provided:
Ret
|
Vec1
|
Vec2
|
|---|---|---|
| int8 | int8 | uint8
(available only if SIMDPP_HAS_UINT8_SHIFT_R_BY_VECTOR evaluates to nonzero value) |
| uint8 | uint8 | uint8
(available only if SIMDPP_HAS_INT8_SHIFT_R_BY_VECTOR evaluates to nonzero value) |
| int16 | int16 | uint16
(available only if SIMDPP_HAS_UINT16_SHIFT_R_BY_VECTOR evaluates to nonzero value) |
| uint16 | uint16 | uint16
(available only if SIMDPP_HAS_INT16_SHIFT_R_BY_VECTOR evaluates to nonzero value) |
| int32 | int32 | uint32
(available only if SIMDPP_HAS_INT32_SHIFT_R_BY_VECTOR evaluates to nonzero value) |
| uint32 | uint32 | uint32
(available only if SIMDPP_HAS_UINT32_SHIFT_R_BY_VECTOR evaluates to nonzero value) |
The return type is a vector expression.
Parameters[edit]
| a | - | integer vector to shift |
| shift | - | integer vector containing the number of bits to shift |
Return value[edit]
A vector expression evaluating to a >> shift.
Equivalent operation[edit]
r0 = a0 >> shift0 ... rN = aN >> shiftN
See also[edit]
| performs right shift by scalar (function template) |