E.V.E  0.1-beta

◆ bit_or

eve::bit_or = {}
inlineconstexpr

Callable object computing the bitwise OR operation.

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

Members Functions

Member Effect
operator() the bitwise OR 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

A value of the same type as a0 containing the elementwise bitwise OR of a0 and all xs following the bitwise operations semantic.

Warning
Although the infix notation with | is supported for two parameters, the | operator on standard scalar types is the original one and so can lead to automatic promotion and due to C++ limitation is not available for floating point scalar entries.

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

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

Parameters

cond : conditional expression

Return value

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


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/bit_or.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_or(pi, qi) = " << eve::bit_or(pi, qi) << '\n'
<< " -> bit_or(z, qi) = " << eve::bit_or(z, qi) << '\n'
<< " -> bit_or(pi, z ) = " << eve::bit_or(pi, z) << '\n';
std::uint32_t mask = 1 >> 31;
float xi = -3.4565;
std::cout << "---- scalar" << '\n'
<< " <- xi = " << xi << '\n'
<< " <- mask = " << mask << '\n'
<< " -> bit_or(xi, mask) = " << eve::bit_or(xi, mask) << '\n';
return 0;
}
constexpr callable_bit_or_ bit_or
Callable object computing the bitwise OR operation.
Definition: bit_or.hpp:79
constexpr callable_pi_ pi
Callable object computing the value.
Definition: pi.hpp:54
Wrapper for SIMD registers.
Definition: wide.hpp:65