diff options
Diffstat (limited to 'src/arch/portable.h')
| -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 | } | ||
