E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ blend

eve::blend = detail::named_shuffle_2<blend_t> {}
inlineconstexpr
Note
You might be looking for eve::if_else_.

Defined in Header

#include <eve/module/core.hpp>

(TODO: support mixing more than 2 registers)

Accepts a pattern with just 0 and 1 that indicates number of the element for the current slot

blend([0, 1, 2, 3], [4, 5, 6, 7], pattern<1, 0, 0, 1>) -> [4, 1, 2, 7].

As any named shuffle, allows to specify a group size.

template<simd_value T, std::ptrdiff_t G, std::ptrdiff_t ...I> // (1)
template<simd_value T, std::ptrdiff_t G>
template<simd_value T, std::ptrdiff_t ...I> // (2)
template<simd_value T, std::ptrdiff_t ...I>
what callable can be a pattern formula
Definition pattern.hpp:99
Specifies that a type is a SIMD type. The concept simd_value<T> is satisfied if and only if T satisfi...
Definition vectorized.hpp:34
constexpr auto blend
a named shuffle for mixing 2 registers together, without changing positions.
Definition blend.hpp:150
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107

Parameters

  • x, y - values to shuffle.
  • G - (optional) - number of elements to treat as one.
  • pattern - how to shuffle elements I == 0 -> take a group from x I == 1 -> take a group from y
  • gen - eve::pattern_formula = alternative way to specify a pattern, computing it from index and size.

Return value

Returns a register with elements selected according to the mask.

Example

#include <eve/module/core.hpp>
#include <tts/tts.hpp>
int
{
w_t x {0, 1, 2, 3};
w_t y {4, 5, 6, 7};
// basic example
// basic example, formula
eve::all(w_t{0, 5, 2, 7} == eve::blend(x, y, [](int i, int /*size*/) { return i % 2; })));
// mixing groups
}
constexpr auto all
Computes a bool value which is true if and only if every elements of x evaluates to true.
Definition all.hpp:95