◆ rror()

Value boost::simd::rror ( Value const &  x,
IntegerValue const &  n 
)

This function object returns the first entry rotated right or left by the absolute value of the second entry, according to its sign.

Header <boost/simd/function/rror.hpp>
Note
This function asserts if the integral parameter is out of range
See also
ror, rrol, ror
Example:
#include <boost/simd/bitwise.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using iT = std::int32_t;
using pack_it = bs::pack<iT, 4>;
int main() {
pack_it pi = {1, 2, -1, 3};
pack_it qi = {1, -2, 4, -3};
std::cout << "---- simd" << '\n'
<< "<- pi = " << pi << '\n'
<< "<- qi = " << qi << '\n'
<< "-> bs::rror(pi, qi) = " << bs::rror(pi, qi) << '\n';
iT xi = 2, yi = 3;
std::cout << "---- scalar" << '\n'
<< "<- xi = " << xi << '\n'
<< "<- yi = " << yi << '\n'
<< "-> bs::rror(xi, yi) = " << bs::rror(xi, yi) << '\n';
return 0;
}
Possible output:
---- simd
<- pi = (1, 2, -1, 3)
<- qi = (1, -2, 4, -3)
-> bs::rror(pi, qi) = (-2147483648, 8, -1, 24)
---- scalar
<- xi = 2
<- yi = 3
-> bs::rror(xi, yi) = 1073741824