aboutsummaryrefslogtreecommitdiff
path: root/src/cube_portable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cube_portable.h')
-rw-r--r--src/cube_portable.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/src/cube_portable.h b/src/cube_portable.h
index fcd1d55..125c300 100644
--- a/src/cube_portable.h
+++ b/src/cube_portable.h
@@ -17,9 +17,12 @@ _static_inline int64_t coord_fast_co(cube_fast_t);
17_static_inline int64_t coord_fast_csep(cube_fast_t); 17_static_inline int64_t coord_fast_csep(cube_fast_t);
18_static_inline int64_t coord_fast_cocsep(cube_fast_t); 18_static_inline int64_t coord_fast_cocsep(cube_fast_t);
19_static_inline int64_t coord_fast_eo(cube_fast_t); 19_static_inline int64_t coord_fast_eo(cube_fast_t);
20_static_inline void set_eo_fast(cube_fast_t *, int64_t eo);
21_static_inline int64_t coord_fast_esep(cube_fast_t); 20_static_inline int64_t coord_fast_esep(cube_fast_t);
22 21
22_static_inline void copy_corners_fast(cube_fast_t *, cube_fast_t);
23_static_inline void copy_edges_fast(cube_fast_t *, cube_fast_t);
24_static_inline void set_eo_fast(cube_fast_t *, int64_t);
25
23_static_inline cube_fast_t 26_static_inline cube_fast_t
24fastcube( 27fastcube(
25 uint8_t c_ufr, 28 uint8_t c_ufr,
@@ -189,12 +192,6 @@ coord_fast_eo(cube_fast_t c)
189 return ret; 192 return ret;
190} 193}
191 194
192_static_inline void
193_set_eo_fast(cube_fast_t *cube, int64_t eo)
194{
195 /* TODO */
196}
197
198/* 195/*
199We encode the edge separation as a number from 0 to C(12,4)*C(8,4). 196We encode the edge separation as a number from 0 to C(12,4)*C(8,4).
200It can be seen as the composition of two "subset index" coordinates. 197It can be seen as the composition of two "subset index" coordinates.
@@ -229,3 +226,28 @@ coord_fast_esep(cube_fast_t c)
229 226
230 return ret1 * 70 + ret2; 227 return ret1 * 70 + ret2;
231} 228}
229
230_static_inline void
231copy_corners_fast(cube_fast_t *dest, cube_fast_t src)
232{
233 memcpy(&dest->corner, src.corner, sizeof(src.corner));
234}
235
236_static_inline void
237copy_edges_fast(cube_fast_t *dest, cube_fast_t src)
238{
239 memcpy(&dest->edge, src.edge, sizeof(src.edge));
240}
241
242_static_inline void
243set_eo_fast(cube_fast_t *cube, int64_t eo)
244{
245 int i, sum, flip;
246
247 for (sum = 0, i = 1; i < 12; i++, eo >>= 1) {
248 flip = eo % 2;
249 sum += flip;
250 cube->edge[i] = (cube->edge[i] & ~_eobit) | (_eobit * flip);
251 }
252 cube->edge[0] = (cube->edge[0] & ~_eobit) | (_eobit * (sum%2));
253}

Generated with cgit - Back to sebastiano.tronto.net