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/portable.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/arch/portable.h') diff --git a/src/arch/portable.h b/src/arch/portable.h index 26001ee..d673f15 100644 --- a/src/arch/portable.h +++ b/src/arch/portable.h @@ -356,3 +356,14 @@ invcoord_epe(uint64_t i) return STATIC_CUBE(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, e[0]+8, e[1]+8, e[2]+8, e[3]+8); } + +STATIC_INLINE bool +is_eo_even(cube_t cube) +{ + uint8_t i, count; + + for (i = 0, count = 0; i < 12; i++) + count += (cube.edge[i] & EOBIT) >> EOSHIFT; + + return count % 2 == 0; +} -- cgit v1.3