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/neon.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/arch/neon.h') diff --git a/src/arch/neon.h b/src/arch/neon.h index 5723b60..2c35c58 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h @@ -1,5 +1,6 @@ -#define CO2_NEON vdup_n_u8(0x60) -#define COCW_NEON vdup_n_u8(0x20) +#define CO2_NEON vdup_n_u8(0x60) +#define COCW_NEON vdup_n_u8(0x20) +#define EO_NEON vdupq_n_u8(0x10) #define PBITS8_NEON vdup_n_u8(PBITS) STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t); @@ -501,3 +502,16 @@ invcoord_epe(uint64_t i) .edge = vcombine_u8(vld1_u8(SOLVED_L), a) }; } + +STATIC_INLINE bool +is_eo_even(cube_t cube) +{ + int8_t count; + uint8x16_t e; + + e = vandq_u8(cube.edge, EO_NEON); + e = vshrq_n_u8(e, EOSHIFT); + count = vaddvq_u8(e); + + return count % 2 == 0; +} -- cgit v1.3