Open chfast opened 8 months ago
New idea https://godbolt.org/z/Ge7TanY3M
auto lt_avx_v2_8(const u256& x, const u256& y)
{
auto xv = std::bit_cast<__m256i>(x);
auto yv = std::bit_cast<__m256i>(y);
auto gtv = _mm256_cmpgt_epi8(xv, yv);
auto ltv = _mm256_cmpgt_epi8(yv, xv);
unsigned gt = _mm256_movemask_epi8(gtv);
unsigned lt = _mm256_movemask_epi8(ltv);
return lt > gt;
}
https://godbolt.org/z/xEcGzqKo9