From 7ff76870242b6906b6f3caf22da3c094822ed140 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 1 Aug 2025 23:32:19 +0200 Subject: Move is_eo_even to more appropriate module --- src/arch/avx2.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/arch/avx2.h') diff --git a/src/arch/avx2.h b/src/arch/avx2.h index 3fb46c9..cb9c0cd 100644 --- a/src/arch/avx2.h +++ b/src/arch/avx2.h @@ -426,3 +426,17 @@ invcoord_epe(uint64_t i) return _mm256_set_epi64x(a, SOLVED_L, 0, SOLVED_L); } + +STATIC_INLINE bool +is_eo_even(cube_t cube) +{ + uint8_t count; + __m256i e; + + e = _mm256_and_si256(cube, EO_AVX2); + e = _mm256_srli_si256(e, EOSHIFT); + + count = _mm256_reduce_add_epi8(e); + + return count % 2 == 0; +} -- cgit v1.3