Skip to content

Commit

Permalink
Use a dedicated test instruction rather than a workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
rhpvorderman committed Dec 16, 2024
1 parent 1927740 commit 65af499
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/sequali/_qcmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2464,13 +2464,7 @@ find_four_matchers_avx2(const uint8_t *sequence, size_t sequence_length,
uint8_t index = NUCLEOTIDE_TO_INDEX[sequence[pos]];
R = _mm256_and_si256(R, _mm256_loadu_si256((__m256i *)bitmask[index]));

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

Expand Down

0 comments on commit 65af499

Please sign in to comment.