From 1254842c5dc23e2534c201deead4b4012a4faa54 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 27 Aug 2024 01:09:39 +0200 Subject: Use _mm256_testz_si256() --- c/simd-isascii/isascii.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'c') diff --git a/c/simd-isascii/isascii.c b/c/simd-isascii/isascii.c index 24ef4fc..9e2b11a 100644 --- a/c/simd-isascii/isascii.c +++ b/c/simd-isascii/isascii.c @@ -36,9 +36,7 @@ strisascii_avx2(const unsigned char *s, size_t n) { __m256i msk = _mm256_set1_epi8((char)(1 << 7)); while (n >= sizeof(__m256i)) { - __m256i v = - _mm256_and_si256(_mm256_loadu_si256((const __m256i *)s), msk); - if (_mm256_movemask_epi8(v) != 0) + if (_mm256_testz_si256(_mm256_loadu_si256((__m256i *)s), msk) == 0) return false; s += sizeof(__m256i); n -= sizeof(__m256i); -- cgit v1.2.3