E.V.E
v2023.02.15

◆ bit_ornot

eve::bit_ornot = {}
inlineconstexpr

Computes the bitwise ORNOT of its arguments.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T, eve::value Ts... >
T bit_ornot(T x, Ts... xs) noexcept;
}
Definition: value.hpp:31
constexpr callable_bit_ornot_ bit_ornot
Computes the bitwise ORNOT of its arguments.
Definition: bit_ornot.hpp:66
Definition: abi.hpp:18

Parameters

Return value

  • For two parameters it computes the bitwise ORNOT of the two parameters
  • For more than two parameters the call is semantically equivalent to to bit_ornot(a0, bit_or(xs...))
  • The value returned is in the type of the first parameter

Example

#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_ornot(pi, qi) = " << eve::bit_ornot(pi, qi) << '\n'
<< " -> bit_ornot(z, qi) = " << eve::bit_ornot(z, qi) << '\n'
<< " -> bit_ornot(pi, z ) = " << eve::bit_ornot(pi, z) << '\n';
std::uint32_t mask = 1 >> 31;
float xi = -3.4565;
std::cout << "---- scalar" << '\n'
<< " <- xi = " << xi << '\n'
<< " <- mask = " << mask << '\n'
<< " -> bit_ornot(xi, mask) = " << eve::bit_ornot(xi, mask) << '\n';
return 0;
}
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers

  • Masked Call

    The call eve::bit_ornot[mask](x, ...) provides a masked version of bit_ornot which is equivalent to if_else(mask, bit_ornot(x, ...), x)

    Example

    #include <eve/module/core.hpp>
    #include <eve/wide.hpp>
    #include <iostream>
    int main()
    {
    w_t pi = {3, 2, 3, 4}, qi = {4, 1, 1, ~0};
    std::cout << "---- simd" << '\n'
    << " <- pi = " << pi << '\n'
    << " <- qi = " << qi << '\n'
    << " -> bit_ornot[pi < qi](pi, qi) = " << eve::bit_ornot[pi < qi](pi, qi) << '\n';
    return 0;
    }