aboutsummaryrefslogtreecommitdiff
path: root/src/arch/neon.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-08-01 23:32:19 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-08-01 23:32:19 +0200
commit7ff76870242b6906b6f3caf22da3c094822ed140 (patch)
treea99748ace111c77a30bb0e615b28cfb7aab0db1e /src/arch/neon.h
parent1bd4691d9cc46ec75adbe899b289a1ebc5460721 (diff)
downloadnissy-core-7ff76870242b6906b6f3caf22da3c094822ed140.tar.gz
nissy-core-7ff76870242b6906b6f3caf22da3c094822ed140.zip
Move is_eo_even to more appropriate module
Diffstat (limited to 'src/arch/neon.h')
-rw-r--r--src/arch/neon.h18
1 files changed, 16 insertions, 2 deletions
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 @@
1#define CO2_NEON vdup_n_u8(0x60) 1#define CO2_NEON vdup_n_u8(0x60)
2#define COCW_NEON vdup_n_u8(0x20) 2#define COCW_NEON vdup_n_u8(0x20)
3#define EO_NEON vdupq_n_u8(0x10)
3#define PBITS8_NEON vdup_n_u8(PBITS) 4#define PBITS8_NEON vdup_n_u8(PBITS)
4 5
5STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t); 6STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t);
@@ -501,3 +502,16 @@ invcoord_epe(uint64_t i)
501 .edge = vcombine_u8(vld1_u8(SOLVED_L), a) 502 .edge = vcombine_u8(vld1_u8(SOLVED_L), a)
502 }; 503 };
503} 504}
505
506STATIC_INLINE bool
507is_eo_even(cube_t cube)
508{
509 int8_t count;
510 uint8x16_t e;
511
512 e = vandq_u8(cube.edge, EO_NEON);
513 e = vshrq_n_u8(e, EOSHIFT);
514 count = vaddvq_u8(e);
515
516 return count % 2 == 0;
517}

Generated with cgit - Back to sebastiano.tronto.net