SIMD scan16 for x86 + 32-bit versions
Some checks failed
weaselab/conflict-set/pipeline/head There was a failure building this commit

This commit is contained in:
2024-06-29 15:01:18 -07:00
parent 45da8fb996
commit 81f44d352f

View File

@@ -1823,9 +1823,21 @@ bool scan16(const InternalVersionT *vs, const uint8_t *is, int begin, int end,
indices, _mm_max_epu8(indices, _mm_set1_epi8(end - begin))));
uint32_t compared = 0;
#if INTERNAL_VERSION_32_BIT
__m128i w4[4];
memcpy(w4, vs, sizeof(w4));
uint32_t rv;
memcpy(&rv, &readVersion, sizeof(rv));
const auto rvVec = _mm_set1_epi32(rv);
const auto zero = _mm_setzero_si128();
for (int i = 0; i < 4; ++i) {
compared |= _mm_movemask_ps(_mm_cmpgt_epi32(_mm_sub_epi32(w4[i], rvVec), zero)) << (i * 4);
}
#else
for (int i = 0; i < 16; ++i) {
compared |= (vs[i] > readVersion) << i;
}
#endif
return !(compared & mask);
#else