E.V.E  0.1-beta

◆ bit_notand

eve::bit_notand = {}
inlineconstexpr

Callable object computing the bitwise NOTAND operation.

Required header: #include <eve/function/bit_notand.hpp>

Members Functions

Member Effect
operator() the bitwise NOTAND operation
operator[] Construct a conditional version of current function object

auto operator()(eve::value auto a0, eve::value auto ... xs) const noexcept;
Definition: value.hpp:31

Parameters

a0, xs: Instances of eve::value

Return value

The value returned is of same type as a0 and follows the bitwise operations semantic.

  • For two parameters it computes the bitwise NOTAND of the two parameters
  • For more than two parameters the call is semantically equivalent to to bit_notand(a0, bit_and(xs...))
Warning
the call bit_notand(x, y) is semantically equivalent to ~x & y if x or y is an simd value, but the pure scalar calls imply the original C++ operators an may not exist due to C++ limitations.
Moreover if an hardware intrinsic exists, the infix syntax will not be able to use it.

auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::bit_notand

Parameters

cond : conditional expression

Return value

A Callable object so that the expression bit_notand[cond](x, ...) is equivalent to if_else(cond,bit_notand(x, ...),x)


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/bit_notand.hpp>
#include <eve/literals.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
w_t pi = {3, 2, 3, 4}, qi = {4, 1, 1, ~0};
std::uint32_t z = 5;
std::cout << "---- simd" << '\n'
<< " <- pi = " << pi << '\n'
<< " <- qi = " << qi << '\n'
<< " <- z = " << z << '\n'
<< " -> bit_notand(pi, qi) = " << eve::bit_notand(pi, qi) << '\n'
<< " -> bit_notand(z, qi) = " << eve::bit_notand(z, qi) << '\n'
<< " -> bit_notand(pi, z ) = " << eve::bit_notand(pi, z) << '\n';
std::uint32_t mask = 1 >> 31;
float xi = -3.4565;
std::cout << "---- scalar" << '\n'
<< " <- xi = " << xi << '\n'
<< " <- mask = " << mask << '\n'
<< " -> bit_notand(xi, mask) = " << eve::bit_notand(xi, mask) << '\n';
return 0;
}
constexpr callable_bit_notand_ bit_notand
Callable object computing the bitwise NOTAND operation.
Definition: bit_notand.hpp:81
constexpr callable_pi_ pi
Callable object computing the value.
Definition: pi.hpp:54
Wrapper for SIMD registers.
Definition: wide.hpp:65