aboutsummaryrefslogtreecommitdiff
path: root/src/cube_avx2.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-05-18 19:32:31 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-05-18 19:32:31 +0200
commit413cc53c97f5a665bf84098b47e8d2267002f3ce (patch)
tree1d4cbae171f93e76f8587c5b10ca6ba4598caab8 /src/cube_avx2.h
parent869d852bd7bf0531af4605773615c0bf0c911d48 (diff)
downloadnissy-core-413cc53c97f5a665bf84098b47e8d2267002f3ce.tar.gz
nissy-core-413cc53c97f5a665bf84098b47e8d2267002f3ce.zip
Added esep inverse coord
Diffstat (limited to 'src/cube_avx2.h')
-rw-r--r--src/cube_avx2.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/cube_avx2.h b/src/cube_avx2.h
index 30b0c0f..d39da94 100644
--- a/src/cube_avx2.h
+++ b/src/cube_avx2.h
@@ -273,6 +273,35 @@ set_eo_fast(cube_fast_t *cube, int64_t eo)
273_static_inline cube_fast_t 273_static_inline cube_fast_t
274invcoord_fast_esep(int64_t esep) 274invcoord_fast_esep(int64_t esep)
275{ 275{
276 /* TODO */ 276 cube_fast_t eee, ret;
277 return cubetofast(zero); 277 int64_t i, j, k, l, s, v, w, is1, set1, set2;
278 uint8_t bit2, bit1, mem[32];
279 uint8_t slice[3] = {0};
280
281 set1 = esep % 70;
282 set2 = esep / 70;
283
284 for (i = 0, j = 0, k = 4, l = 4; i < 12; i++) {
285 v = binomial[11-i][k];
286 w = binomial[7-j][l];
287 bit2 = set2 >= v;
288 bit1 = set1 >= w;
289 is1 = (1 - bit2) * bit1;
290
291 set2 -= bit2 * v;
292 k -= bit2;
293 set1 -= is1 * w;
294 l -= is1;
295 j += (1-bit2);
296 s = 2*bit2 + (1-bit2)*bit1;
297
298 mem[i+16] = (slice[s]++) | (s << 2);
299 }
300
301 ret = cubetofast(solved);
302 eee = _mm256_loadu_si256((__m256i_u *)&mem);
303 copy_edges_fast(&ret, eee);
304
305 return ret;
278} 306}
307

Generated with cgit - Back to sebastiano.tronto.net