Optional last parameter allows to ovewrite the equality from eve::is_equal to an arbitrary simd binary predicate.
We took the idea for the operation from: "Faster-Than-Native Alternatives for x86 VP2INTERSECT Instructions" by Guillermo Diez-Canas. Link: https://arxiv.org/abs/2112.06342
Defined in Header
#include <eve/module/core.hpp>
{
template<simd_value T>
template<simd_value T, simd_value U, simd_predicate<T, U> Op>
constexpr auto has_equal_in(T x, U match_against, Op op)
noexcept;
}
constexpr auto has_equal_in
Given two simd_values: x, match_against returns a logical mask. The res[i] == eve::any(x[i] == match_...
Definition has_equal_in.hpp:88
EVE Main Namespace.
Definition abi.hpp:19
Parameters
- x : argument.
- match_against argument.
- op : The binary predicate to use for the comparison.
Return value
- A logical SIMD value built as described previously.
- Same as 1. but uses a custom predicate instead of eve::is_equal.
#include <iostream>
#include <eve/module/core.hpp>
int main()
{
wide_it x = {2, 1, 2, 4};
wide_it y = {0, 2, 3, 1};
std::cout << "---- simd" << '\n'
<< "<- x = " << x << '\n'
<< "<- y = " << y << '\n'
}
Wrapper for SIMD registers.
Definition wide.hpp:94