◆ bitwise_andnot()

Value0 boost::simd::bitwise_andnot ( Value0 const &  x,
Value1 const &  y 
)

This function object computes the bitwise and not of its parameters.

The result type is the one of the first operand.

Header <boost/simd/function/bitwise_andnot.hpp>
Precondition
The operands must share the same bit size.
Example:
#include <boost/simd/bitwise.hpp>
#include <boost/simd/constant/nan.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
int main() {
pack_it pi = {3, -2, 3, 3};
pack_it qi = {4, -1, 0, ~0};
std::cout << "---- simd" << '\n'
<< " <- pi = " << pi << '\n'
<< " <- qi = " << qi << '\n'
<< " -> bs::bitwise_andnot(pi, qi) = " << bs::bitwise_andnot(pi, qi)
<< '\n';
std::uint32_t xi = 3, yi = 1;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
<< " -> bs::bitwise_andnot(xi, yi) = " << bs::bitwise_andnot(xi, yi)
<< '\n';
return 0;
}
Possible output:
---- simd
<- pi = (3, 4294967294, 3, 3)
<- qi = (4, 4294967295, 0, 4294967295)
-> bs::bitwise_andnot(pi, qi) = (3, 0, 3, 0)
---- scalar
xi = 3
yi = 1
-> bs::bitwise_andnot(xi, yi) = 2