From fe534f1497da6447153064d7bba00243000f803b Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 6 Apr 2026 15:18:26 +0200 Subject: Added popcount_u64 --- src/arch/neon.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/arch/neon.h') diff --git a/src/arch/neon.h b/src/arch/neon.h index f997813..725e589 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h @@ -47,6 +47,17 @@ popcount_u32(uint32_t x) return (int)x; } +STATIC_INLINE int +popcount_u64(uint64_t x) +{ + int top, bottom; + + bottom = popcount_u32((uint32_t)(x & UINT64_C(0xFFFFFFFF))); + top = popcount_u32((uint32_t)(x >> UINT64_C(32))); + + return top + bottom; +} + STATIC void pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) { -- cgit v1.3