diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-01 23:32:19 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-01 23:32:19 +0200 |
| commit | 7ff76870242b6906b6f3caf22da3c094822ed140 (patch) | |
| tree | a99748ace111c77a30bb0e615b28cfb7aab0db1e /src/arch/portable.h | |
| parent | 1bd4691d9cc46ec75adbe899b289a1ebc5460721 (diff) | |
| download | nissy-core-7ff76870242b6906b6f3caf22da3c094822ed140.tar.gz nissy-core-7ff76870242b6906b6f3caf22da3c094822ed140.zip | |
Move is_eo_even to more appropriate module
Diffstat (limited to '')
| -rw-r--r-- | src/arch/portable.h | 11 |
1 files changed, 11 insertions, 0 deletions
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) | |||
| 356 | return STATIC_CUBE(0, 1, 2, 3, 4, 5, 6, 7, | 356 | return STATIC_CUBE(0, 1, 2, 3, 4, 5, 6, 7, |
| 357 | 0, 1, 2, 3, 4, 5, 6, 7, e[0]+8, e[1]+8, e[2]+8, e[3]+8); | 357 | 0, 1, 2, 3, 4, 5, 6, 7, e[0]+8, e[1]+8, e[2]+8, e[3]+8); |
| 358 | } | 358 | } |
| 359 | |||
| 360 | STATIC_INLINE bool | ||
| 361 | is_eo_even(cube_t cube) | ||
| 362 | { | ||
| 363 | uint8_t i, count; | ||
| 364 | |||
| 365 | for (i = 0, count = 0; i < 12; i++) | ||
| 366 | count += (cube.edge[i] & EOBIT) >> EOSHIFT; | ||
| 367 | |||
| 368 | return count % 2 == 0; | ||
| 369 | } | ||
