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/avx2.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 'src/arch/avx2.h')
| -rw-r--r-- | src/arch/avx2.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/arch/avx2.h b/src/arch/avx2.h index 3fb46c9..cb9c0cd 100644 --- a/src/arch/avx2.h +++ b/src/arch/avx2.h | |||
| @@ -426,3 +426,17 @@ invcoord_epe(uint64_t i) | |||
| 426 | 426 | ||
| 427 | return _mm256_set_epi64x(a, SOLVED_L, 0, SOLVED_L); | 427 | return _mm256_set_epi64x(a, SOLVED_L, 0, SOLVED_L); |
| 428 | } | 428 | } |
| 429 | |||
| 430 | STATIC_INLINE bool | ||
| 431 | is_eo_even(cube_t cube) | ||
| 432 | { | ||
| 433 | uint8_t count; | ||
| 434 | __m256i e; | ||
| 435 | |||
| 436 | e = _mm256_and_si256(cube, EO_AVX2); | ||
| 437 | e = _mm256_srli_si256(e, EOSHIFT); | ||
| 438 | |||
| 439 | count = _mm256_reduce_add_epi8(e); | ||
| 440 | |||
| 441 | return count % 2 == 0; | ||
| 442 | } | ||
