aboutsummaryrefslogtreecommitdiff
path: root/src/arch/avx2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/avx2.h')
-rw-r--r--src/arch/avx2.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/arch/avx2.h b/src/arch/avx2.h
index cb9c0cd..74aad53 100644
--- a/src/arch/avx2.h
+++ b/src/arch/avx2.h
@@ -430,13 +430,12 @@ invcoord_epe(uint64_t i)
430STATIC_INLINE bool 430STATIC_INLINE bool
431is_eo_even(cube_t cube) 431is_eo_even(cube_t cube)
432{ 432{
433 uint8_t count; 433 uint32_t mask;
434 __m256i e; 434 __m256i e;
435 435
436 e = _mm256_and_si256(cube, EO_AVX2); 436 e = _mm256_and_si256(cube, EO_AVX2);
437 e = _mm256_srli_si256(e, EOSHIFT); 437 e = _mm256_slli_epi16(e, 7-EOSHIFT);
438 mask = _mm256_movemask_epi8(e);
438 439
439 count = _mm256_reduce_add_epi8(e); 440 return popcount_u32(mask) % 2;
440
441 return count % 2 == 0;
442} 441}

Generated with cgit - Back to sebastiano.tronto.net