Skip to content

Commit 65af499

Browse files
committed
Use a dedicated test instruction rather than a workaround
1 parent 1927740 commit 65af499

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/sequali/_qcmodule.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,13 +2464,7 @@ find_four_matchers_avx2(const uint8_t *sequence, size_t sequence_length,
24642464
uint8_t index = NUCLEOTIDE_TO_INDEX[sequence[pos]];
24652465
R = _mm256_and_si256(R, _mm256_loadu_si256((__m256i *)bitmask[index]));
24662466

2467-
__m256i check = _mm256_and_si256(R, found_mask);
2468-
/* Adding 0b01111111 (127) to any number higher than 0 sets the bit for
2469-
128. Movemask collects these bits. This way we can test if there is
2470-
a 1 across the entire 256-bit vector. */
2471-
int check_int =
2472-
_mm256_movemask_epi8(_mm256_adds_epu8(check, _mm256_set1_epi8(127)));
2473-
if (check_int) {
2467+
if (!_mm256_testz_si256(R, found_mask)) {
24742468
bitmask_t Rray[4];
24752469
_mm256_storeu_si256(((__m256i *)Rray), R);
24762470

0 commit comments

Comments
 (0)