aboutsummaryrefslogtreecommitdiff
path: root/src/arch/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/common.h')
-rw-r--r--src/arch/common.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/arch/common.h b/src/arch/common.h
index cd2d36e..d8d2305 100644
--- a/src/arch/common.h
+++ b/src/arch/common.h
@@ -17,3 +17,31 @@ _static_inline void copy_corners(cube_t *, cube_t);
17_static_inline void copy_edges(cube_t *, cube_t); 17_static_inline void copy_edges(cube_t *, cube_t);
18_static_inline void set_eo(cube_t *, int64_t); 18_static_inline void set_eo(cube_t *, int64_t);
19_static_inline cube_t invcoord_esep(int64_t); 19_static_inline cube_t invcoord_esep(int64_t);
20
21_static_inline void invcoord_esep_array(int64_t, int64_t, uint8_t[static 12]);
22
23_static_inline void
24invcoord_esep_array(int64_t set1, int64_t set2, uint8_t mem[static 12])
25{
26 int64_t bit1, bit2, i, j, jj, k, l, s, v, w, is1;
27 uint8_t slice[3] = {0};
28
29 for (i = 0, j = 0, k = 4, l = 4; i < 12; i++)
30 {
31 v = binomial[11 - i][k];
32 jj = j < 8;
33 w = jj * binomial[7 - (j * jj)][l];
34 bit2 = set2 >= v;
35 bit1 = set1 >= w;
36 is1 = (1 - bit2) * bit1;
37
38 set2 -= bit2 * v;
39 k -= bit2;
40 set1 -= is1 * w;
41 l -= is1;
42 j += (1 - bit2);
43 s = 2 * bit2 + (1 - bit2) * bit1;
44
45 mem[i] = (slice[s]++) | (uint8_t)(s << 2);
46 }
47}

Generated with cgit - Back to sebastiano.tronto.net