Logical operations
swap_if, logical_and, logical_andnot, logical_not, logical_notand, logical_notor, logical_or, logical_ornot, replace_ignored.
Functions | |
| template<logical_value Mask, value Value> | |
| void | eve::swap_if (Mask const &mask, Value &lhs, Value &rhs) noexcept |
| Conditional swap. | |
Variables | |
| constexpr auto | eve::if_else = functor<if_else_t> |
| Select value based on conditional mask or values. | |
| constexpr auto | eve::logical_and = functor<logical_and_t> |
| strict_elementwise_callable computing the logical AND of its arguments. | |
| constexpr auto | eve::logical_andnot = functor<logical_andnot_t> |
| Computes the logical ANDNOT of its arguments. | |
| constexpr auto | eve::logical_not = functor<logical_not_t> |
| Computes the logical NOT of its argument. | |
| constexpr auto | eve::logical_notand = functor<logical_notand_t> |
| Computes the logical NOTAND of its arguments. | |
| constexpr auto | eve::logical_notor = functor<logical_notor_t> |
| Computes the logical NOTOR of its arguments. | |
| constexpr auto | eve::logical_or = functor<logical_or_t> |
| Computes the logical OR of its arguments. | |
| constexpr auto | eve::logical_ornot = functor<logical_ornot_t> |
| Computes the logical ORNOT of its arguments. | |
| constexpr auto | eve::logical_xor = functor<logical_xor_t> |
| Computes the logical XOR of its arguments. | |
| constexpr auto | eve::replace_ignored = functor<replace_ignored_t> |
| A small helper to replace ignored values. | |
|
noexcept |
Conditional swap.
Required header: #include <eve/module/core.hpp>
Swaps the SIMD values lhs and rhs wherever mask evaluates to true.
| mask | Mask to apply over the swap operation. |
| lhs,rhs | Values to swap. |
|
inlineconstexpr |
Select value based on conditional mask or values.
Defined in Header
Parameters
Return value
The call if_else(mask, t, f) performs an elementwise selection between the elements of t and f according to the value of the elements of mask.
Possible optimizations
The following calls, where t and f are values, are optimized so the constant are not evaluated:
In addition, the following calls, where t and f are unsigned values, are optimized so the constant are not evaluated:
|
inlineconstexpr |
strict_elementwise_callable computing the logical AND of its arguments.
Parameters
Return value
Returns the logical AND of the two parameters following the logical operations semantic.
The call logical_and(x, y) is semantically equivalent to x && y if x or y is an simd value and does not shortcut.
|
inlineconstexpr |
Computes the logical ANDNOT of its arguments.
Parameters
Return value
Returns the logical ANDNOT of the two parameters following the logical operations semantic.
The call logical_andnot(x, y) is semantically equivalent to x && !y if x or y is an simd value and does not shortcut.
|
inlineconstexpr |
Computes the logical NOT of its argument.
Parameters
Return value
The call logical_not(x) is semantically equivalent to is_eqz(x). Infix notation can be used with !x.
|
inlineconstexpr |
Computes the logical NOTAND of its arguments.
Parameters
Return value
Returns the logical NOTAND of the two parameters following the logical operations semantic.
The call logical_notand(x, y) is semantically equivalent to !x && y if x or y is an simd value and does not shortcut.
|
inlineconstexpr |
Computes the logical NOTOR of its arguments.
Parameters
Return value
Returns the logical NOTOR of the two parameters following the logical operations semantic.
The call logical_notor(x, y) is semantically equivalent to !x || y if x or y is an simd value and does not shortcut.
|
inlineconstexpr |
Computes the logical OR of its arguments.
Parameters
Return value
Returns the logical OR of the two parameters following the logical operations semantic.
The call logical_or(x, y) is semantically equivalent to x || y if x or y is an simd value and does not shortcut.
|
inlineconstexpr |
Computes the logical ORNOT of its arguments.
Parameters
Return value
Returns the logical ORNOT of the two parameters following the logical operations semantic.
The call `logical_ornot(x, y)` is semantically equivalent to `x || !y` if `x` or `y` is an [simd value](@ref eve::simd_value) and does not shortcut.
|
inlineconstexpr |
Computes the logical XOR of its arguments.
Parameters
Return value
Returns the logical XOR of the two parameters following the logical operations semantic.
The call logical_xor(x, y) is semantically equivalent to (x && !y) || (!x && y).
|
inlineconstexpr |
A small helper to replace ignored values.
A convenience wrapper around if_else.
Parameters
Return value
Same as if_else.