diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-05 10:04:34 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-05 10:04:34 +0200 |
| commit | b17411249b17133f35833c202e6c2e4bf43b3298 (patch) | |
| tree | 3417a006ee5207b4ff9a2bfcc4bc971853d24577 /src | |
| parent | fd5ddb3db9f50411ca579d84f225f265ca35b56a (diff) | |
| download | nissy-core-b17411249b17133f35833c202e6c2e4bf43b3298.tar.gz nissy-core-b17411249b17133f35833c202e6c2e4bf43b3298.zip | |
More renaming
Diffstat (limited to 'src')
| -rw-r--r-- | src/arch/avx2.h | 48 | ||||
| -rw-r--r-- | src/arch/neon.h | 22 | ||||
| -rw-r--r-- | src/arch/portable.h | 14 | ||||
| -rw-r--r-- | src/core/constant_cubes.h | 228 | ||||
| -rw-r--r-- | src/core/cube.h | 33 | ||||
| -rw-r--r-- | src/core/io_cube.h | 14 | ||||
| -rw-r--r-- | src/core/moves.h | 86 | ||||
| -rw-r--r-- | src/core/transform.h | 8 | ||||
| -rw-r--r-- | src/core/transform_with_switch.h | 8 | ||||
| -rw-r--r-- | src/nissy.c | 4 | ||||
| -rw-r--r-- | src/solvers/h48/coordinate.h | 2 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_cocsep.h | 2 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 10 | ||||
| -rw-r--r-- | src/solvers/h48/map.h | 2 | ||||
| -rw-r--r-- | src/utils/math.h | 8 |
15 files changed, 245 insertions, 244 deletions
diff --git a/src/arch/avx2.h b/src/arch/avx2.h index 8d53f8f..2c3371e 100644 --- a/src/arch/avx2.h +++ b/src/arch/avx2.h | |||
| @@ -1,19 +1,19 @@ | |||
| 1 | #define _co2_avx2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x6060606060606060)) | 1 | #define CO2_AVX2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x6060606060606060)) |
| 2 | #define _cocw_avx2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x2020202020202020)) | 2 | #define COCW_AVX2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x2020202020202020)) |
| 3 | #define _cp_avx2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x0707070707070707)) | 3 | #define CP_AVX2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x0707070707070707)) |
| 4 | #define _ep_avx2 \ | 4 | #define EP_AVX2 \ |
| 5 | _mm256_set_epi64x(INT64_C(0x0F0F0F0F), INT64_C(0x0F0F0F0F0F0F0F0F), 0, 0) | 5 | _mm256_set_epi64x(INT64_C(0x0F0F0F0F), INT64_C(0x0F0F0F0F0F0F0F0F), 0, 0) |
| 6 | #define _eo_avx2 \ | 6 | #define EO_AVX2 \ |
| 7 | _mm256_set_epi64x(INT64_C(0x10101010), INT64_C(0x1010101010101010), 0, 0) | 7 | _mm256_set_epi64x(INT64_C(0x10101010), INT64_C(0x1010101010101010), 0, 0) |
| 8 | 8 | ||
| 9 | #define static_cube(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ | 9 | #define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ |
| 10 | e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \ | 10 | e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \ |
| 11 | _mm256_set_epi8(0, 0, 0, 0, e_br, e_bl, e_fl, e_fr, \ | 11 | _mm256_set_epi8(0, 0, 0, 0, e_br, e_bl, e_fl, e_fr, \ |
| 12 | e_dr, e_dl, e_ul, e_ur, e_df, e_db, e_ub, e_uf, \ | 12 | e_dr, e_dl, e_ul, e_ur, e_df, e_db, e_ub, e_uf, \ |
| 13 | 0, 0, 0, 0, 0, 0, 0, 0, \ | 13 | 0, 0, 0, 0, 0, 0, 0, 0, \ |
| 14 | c_dbl, c_dfr, c_ubr, c_ufl, c_dbr, c_dfl, c_ubl, c_ufr) | 14 | c_dbl, c_dfr, c_ubr, c_ufl, c_dbr, c_dfl, c_ubl, c_ufr) |
| 15 | #define zero _mm256_set_epi64x(0, 0, 0, 0) | 15 | #define ZERO_CUBE _mm256_set_epi64x(0, 0, 0, 0) |
| 16 | #define solved static_cube( \ | 16 | #define SOLVED_CUBE STATIC_CUBE( \ |
| 17 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) | 17 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) |
| 18 | 18 | ||
| 19 | STATIC void | 19 | STATIC void |
| @@ -43,11 +43,11 @@ invertco(cube_t c) | |||
| 43 | { | 43 | { |
| 44 | cube_t co, shleft, shright, summed, newco, cleanco, ret; | 44 | cube_t co, shleft, shright, summed, newco, cleanco, ret; |
| 45 | 45 | ||
| 46 | co = _mm256_and_si256(c, _co2_avx2); | 46 | co = _mm256_and_si256(c, CO2_AVX2); |
| 47 | shleft = _mm256_slli_epi32(co, 1); | 47 | shleft = _mm256_slli_epi32(co, 1); |
| 48 | shright = _mm256_srli_epi32(co, 1); | 48 | shright = _mm256_srli_epi32(co, 1); |
| 49 | summed = _mm256_or_si256(shleft, shright); | 49 | summed = _mm256_or_si256(shleft, shright); |
| 50 | newco = _mm256_and_si256(summed, _co2_avx2); | 50 | newco = _mm256_and_si256(summed, CO2_AVX2); |
| 51 | cleanco = _mm256_xor_si256(c, co); | 51 | cleanco = _mm256_xor_si256(c, co); |
| 52 | ret = _mm256_or_si256(cleanco, newco); | 52 | ret = _mm256_or_si256(cleanco, newco); |
| 53 | 53 | ||
| @@ -68,7 +68,7 @@ compose_epcpeo(cube_t c1, cube_t c2) | |||
| 68 | s = _mm256_andnot_si256(b, s); | 68 | s = _mm256_andnot_si256(b, s); |
| 69 | 69 | ||
| 70 | /* Change EO */ | 70 | /* Change EO */ |
| 71 | eo2 = _mm256_and_si256(c2, _eo_avx2); | 71 | eo2 = _mm256_and_si256(c2, EO_AVX2); |
| 72 | s = _mm256_xor_si256(s, eo2); | 72 | s = _mm256_xor_si256(s, eo2); |
| 73 | 73 | ||
| 74 | return s; | 74 | return s; |
| @@ -99,16 +99,16 @@ compose(cube_t c1, cube_t c2) | |||
| 99 | s = compose_epcpeo(c1, c2); | 99 | s = compose_epcpeo(c1, c2); |
| 100 | 100 | ||
| 101 | /* Change CO */ | 101 | /* Change CO */ |
| 102 | co1 = _mm256_and_si256(s, _co2_avx2); | 102 | co1 = _mm256_and_si256(s, CO2_AVX2); |
| 103 | co2 = _mm256_and_si256(c2, _co2_avx2); | 103 | co2 = _mm256_and_si256(c2, CO2_AVX2); |
| 104 | aux = _mm256_add_epi8(co1, co2); | 104 | aux = _mm256_add_epi8(co1, co2); |
| 105 | auy1 = _mm256_add_epi8(aux, _cocw_avx2); | 105 | auy1 = _mm256_add_epi8(aux, COCW_AVX2); |
| 106 | auy2 = _mm256_srli_epi32(auy1, 2); | 106 | auy2 = _mm256_srli_epi32(auy1, 2); |
| 107 | auz1 = _mm256_add_epi8(aux, auy2); | 107 | auz1 = _mm256_add_epi8(aux, auy2); |
| 108 | auz2 = _mm256_and_si256(auz1, _co2_avx2); | 108 | auz2 = _mm256_and_si256(auz1, CO2_AVX2); |
| 109 | 109 | ||
| 110 | /* Put together */ | 110 | /* Put together */ |
| 111 | s = _mm256_andnot_si256(_co2_avx2, s); | 111 | s = _mm256_andnot_si256(CO2_AVX2, s); |
| 112 | s = _mm256_or_si256(s, auz2); | 112 | s = _mm256_or_si256(s, auz2); |
| 113 | 113 | ||
| 114 | return s; | 114 | return s; |
| @@ -157,9 +157,9 @@ inverse(cube_t c) | |||
| 157 | vi = _mm256_shuffle_epi8(vi, vi); | 157 | vi = _mm256_shuffle_epi8(vi, vi); |
| 158 | vi = _mm256_shuffle_epi8(vi, c); | 158 | vi = _mm256_shuffle_epi8(vi, c); |
| 159 | 159 | ||
| 160 | vo = _mm256_and_si256(c, _mm256_or_si256(_eo_avx2, _co2_avx2)); | 160 | vo = _mm256_and_si256(c, _mm256_or_si256(EO_AVX2, CO2_AVX2)); |
| 161 | vo = _mm256_shuffle_epi8(vo, vi); | 161 | vo = _mm256_shuffle_epi8(vo, vi); |
| 162 | vp = _mm256_andnot_si256(_mm256_or_si256(_eo_avx2, _co2_avx2), vi); | 162 | vp = _mm256_andnot_si256(_mm256_or_si256(EO_AVX2, CO2_AVX2), vi); |
| 163 | ret = _mm256_or_si256(vp, vo); | 163 | ret = _mm256_or_si256(vp, vo); |
| 164 | ret = cleanaftershuffle(ret); | 164 | ret = cleanaftershuffle(ret); |
| 165 | 165 | ||
| @@ -172,7 +172,7 @@ coord_co(cube_t c) | |||
| 172 | cube_t co; | 172 | cube_t co; |
| 173 | int64_t mem[4], ret, i, p; | 173 | int64_t mem[4], ret, i, p; |
| 174 | 174 | ||
| 175 | co = _mm256_and_si256(c, _co2_avx2); | 175 | co = _mm256_and_si256(c, CO2_AVX2); |
| 176 | _mm256_storeu_si256((__m256i *)mem, co); | 176 | _mm256_storeu_si256((__m256i *)mem, co); |
| 177 | 177 | ||
| 178 | mem[0] >>= 5; | 178 | mem[0] >>= 5; |
| @@ -188,7 +188,7 @@ coord_csep(cube_t c) | |||
| 188 | cube_t cp, shifted; | 188 | cube_t cp, shifted; |
| 189 | int64_t mask; | 189 | int64_t mask; |
| 190 | 190 | ||
| 191 | cp = _mm256_and_si256(c, _cp_avx2); | 191 | cp = _mm256_and_si256(c, CP_AVX2); |
| 192 | shifted = _mm256_slli_epi32(cp, 5); | 192 | shifted = _mm256_slli_epi32(cp, 5); |
| 193 | mask = _mm256_movemask_epi8(shifted); | 193 | mask = _mm256_movemask_epi8(shifted); |
| 194 | 194 | ||
| @@ -207,7 +207,7 @@ coord_eo(cube_t c) | |||
| 207 | cube_t eo, shifted; | 207 | cube_t eo, shifted; |
| 208 | int64_t mask; | 208 | int64_t mask; |
| 209 | 209 | ||
| 210 | eo = _mm256_and_si256(c, _eo_avx2); | 210 | eo = _mm256_and_si256(c, EO_AVX2); |
| 211 | shifted = _mm256_slli_epi32(eo, 3); | 211 | shifted = _mm256_slli_epi32(eo, 3); |
| 212 | mask = _mm256_movemask_epi8(shifted); | 212 | mask = _mm256_movemask_epi8(shifted); |
| 213 | 213 | ||
| @@ -220,7 +220,7 @@ coord_esep(cube_t c) | |||
| 220 | cube_t ep; | 220 | cube_t ep; |
| 221 | int64_t e, mem[4], i, j, jj, k, l, ret1, ret2, bit1, bit2, is1; | 221 | int64_t e, mem[4], i, j, jj, k, l, ret1, ret2, bit1, bit2, is1; |
| 222 | 222 | ||
| 223 | ep = _mm256_and_si256(c, _ep_avx2); | 223 | ep = _mm256_and_si256(c, EP_AVX2); |
| 224 | _mm256_storeu_si256((__m256i *)mem, ep); | 224 | _mm256_storeu_si256((__m256i *)mem, ep); |
| 225 | 225 | ||
| 226 | mem[3] <<= 8; | 226 | mem[3] <<= 8; |
| @@ -278,7 +278,7 @@ set_eo(cube_t *cube, int64_t eo) | |||
| 278 | (eo12 & 1) << 4; | 278 | (eo12 & 1) << 4; |
| 279 | veo = _mm256_set_epi64x(eotop, eobot, 0, 0); | 279 | veo = _mm256_set_epi64x(eotop, eobot, 0, 0); |
| 280 | 280 | ||
| 281 | *cube = _mm256_andnot_si256(_eo_avx2, *cube); | 281 | *cube = _mm256_andnot_si256(EO_AVX2, *cube); |
| 282 | *cube = _mm256_or_si256(*cube, veo); | 282 | *cube = _mm256_or_si256(*cube, veo); |
| 283 | } | 283 | } |
| 284 | 284 | ||
| @@ -290,7 +290,7 @@ invcoord_esep(int64_t esep) | |||
| 290 | 290 | ||
| 291 | invcoord_esep_array(esep % 70, esep / 70, mem+16); | 291 | invcoord_esep_array(esep % 70, esep / 70, mem+16); |
| 292 | 292 | ||
| 293 | ret = solved; | 293 | ret = SOLVED_CUBE; |
| 294 | eee = _mm256_loadu_si256((__m256i_u *)&mem); | 294 | eee = _mm256_loadu_si256((__m256i_u *)&mem); |
| 295 | copy_edges(&ret, eee); | 295 | copy_edges(&ret, eee); |
| 296 | 296 | ||
diff --git a/src/arch/neon.h b/src/arch/neon.h index dee0eba..acb75c3 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h | |||
| @@ -1,21 +1,21 @@ | |||
| 1 | #define _co2_neon vdupq_n_u8(0x60) | 1 | #define CO2_NEON vdupq_n_u8(0x60) |
| 2 | #define _cocw_neon vdupq_n_u8(0x20) | 2 | #define COCW_NEON vdupq_n_u8(0x20) |
| 3 | #define _cp_neon vdupq_n_u8(0x07) | 3 | #define CP_NEON vdupq_n_u8(0x07) |
| 4 | #define _ep_neon vcombine_u8(vdupq_n_u8(0x0F), vdupq_n_u8(0x0F)) | 4 | #define EP_NEON vcombine_u8(vdupq_n_u8(0x0F), vdupq_n_u8(0x0F)) |
| 5 | #define _eo_neon vcombine_u8(vdupq_n_u8(0x10), vdupq_n_u8(0x10)) | 5 | #define EO_NEON vcombine_u8(vdupq_n_u8(0x10), vdupq_n_u8(0x10)) |
| 6 | 6 | ||
| 7 | STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t); | 7 | STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t); |
| 8 | STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t); | 8 | STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t); |
| 9 | 9 | ||
| 10 | // static cube | 10 | // static cube |
| 11 | #define static_cube(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ | 11 | #define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ |
| 12 | e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \ | 12 | e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \ |
| 13 | ((cube_t){ \ | 13 | ((cube_t){ \ |
| 14 | .corner = {c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, 0, 0, 0, 0, 0, 0, 0, 0}, \ | 14 | .corner = {c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, 0, 0, 0, 0, 0, 0, 0, 0}, \ |
| 15 | .edge = {e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br, 0, 0, 0, 0}}) | 15 | .edge = {e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br, 0, 0, 0, 0}}) |
| 16 | 16 | ||
| 17 | // zero cube | 17 | // zero cube |
| 18 | #define zero \ | 18 | #define ZERO_CUBE \ |
| 19 | (cube_t) \ | 19 | (cube_t) \ |
| 20 | { \ | 20 | { \ |
| 21 | .corner = vdupq_n_u8(0), \ | 21 | .corner = vdupq_n_u8(0), \ |
| @@ -23,7 +23,7 @@ STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t); | |||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | // solved cube | 25 | // solved cube |
| 26 | #define solved static_cube( \ | 26 | #define SOLVED_CUBE STATIC_CUBE( \ |
| 27 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) | 27 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) |
| 28 | 28 | ||
| 29 | STATIC void | 29 | STATIC void |
| @@ -68,11 +68,11 @@ invertco(cube_t c) | |||
| 68 | cube_t ret; | 68 | cube_t ret; |
| 69 | uint8x16_t co, shleft, shright, summed, newco, cleanco; | 69 | uint8x16_t co, shleft, shright, summed, newco, cleanco; |
| 70 | 70 | ||
| 71 | co = vandq_u8(c.corner, _co2_neon); | 71 | co = vandq_u8(c.corner, CO2_NEON); |
| 72 | shleft = vshlq_n_u8(co, 1); | 72 | shleft = vshlq_n_u8(co, 1); |
| 73 | shright = vshrq_n_u8(co, 1); | 73 | shright = vshrq_n_u8(co, 1); |
| 74 | summed = vorrq_u8(shleft, shright); | 74 | summed = vorrq_u8(shleft, shright); |
| 75 | newco = vandq_u8(summed, _co2_neon); | 75 | newco = vandq_u8(summed, CO2_NEON); |
| 76 | cleanco = veorq_u8(c.corner, co); | 76 | cleanco = veorq_u8(c.corner, co); |
| 77 | ret.corner = vorrq_u8(cleanco, newco); | 77 | ret.corner = vorrq_u8(cleanco, newco); |
| 78 | ret.edge = c.edge; | 78 | ret.edge = c.edge; |
| @@ -323,7 +323,7 @@ invcoord_esep(int64_t esep) | |||
| 323 | 323 | ||
| 324 | invcoord_esep_array(esep % 70, esep / 70, mem); | 324 | invcoord_esep_array(esep % 70, esep / 70, mem); |
| 325 | 325 | ||
| 326 | ret = solved; | 326 | ret = SOLVED_CUBE; |
| 327 | ret.edge = vld1q_u8(mem); | 327 | ret.edge = vld1q_u8(mem); |
| 328 | 328 | ||
| 329 | return ret; | 329 | return ret; |
diff --git a/src/arch/portable.h b/src/arch/portable.h index fdadb02..e9a8dd0 100644 --- a/src/arch/portable.h +++ b/src/arch/portable.h | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | #define static_cube(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ | 1 | #define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ |
| 2 | e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \ | 2 | e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \ |
| 3 | ((cube_t) { \ | 3 | ((cube_t) { \ |
| 4 | .corner = { c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl }, \ | 4 | .corner = { c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl }, \ |
| 5 | .edge = { e_uf, e_ub, e_db, e_df, e_ur, e_ul, \ | 5 | .edge = { e_uf, e_ub, e_db, e_df, e_ur, e_ul, \ |
| 6 | e_dl, e_dr, e_fr, e_fl, e_bl, e_br } }) | 6 | e_dl, e_dr, e_fr, e_fl, e_bl, e_br } }) |
| 7 | #define zero static_cube( \ | 7 | #define ZERO_CUBE STATIC_CUBE( \ |
| 8 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | 8 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) |
| 9 | #define solved static_cube( \ | 9 | #define SOLVED_CUBE STATIC_CUBE( \ |
| 10 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) | 10 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) |
| 11 | 11 | ||
| 12 | STATIC void | 12 | STATIC void |
| @@ -80,7 +80,7 @@ compose_corners_inplace(cube_t c1, cube_t c2, cube_t *ret) | |||
| 80 | STATIC_INLINE cube_t | 80 | STATIC_INLINE cube_t |
| 81 | compose_edges(cube_t c1, cube_t c2) | 81 | compose_edges(cube_t c1, cube_t c2) |
| 82 | { | 82 | { |
| 83 | cube_t ret = zero; | 83 | cube_t ret = ZERO_CUBE; |
| 84 | 84 | ||
| 85 | compose_edges_inplace(c1, c2, &ret); | 85 | compose_edges_inplace(c1, c2, &ret); |
| 86 | 86 | ||
| @@ -90,7 +90,7 @@ compose_edges(cube_t c1, cube_t c2) | |||
| 90 | STATIC_INLINE cube_t | 90 | STATIC_INLINE cube_t |
| 91 | compose_corners(cube_t c1, cube_t c2) | 91 | compose_corners(cube_t c1, cube_t c2) |
| 92 | { | 92 | { |
| 93 | cube_t ret = zero; | 93 | cube_t ret = ZERO_CUBE; |
| 94 | 94 | ||
| 95 | compose_corners_inplace(c1, c2, &ret); | 95 | compose_corners_inplace(c1, c2, &ret); |
| 96 | 96 | ||
| @@ -100,7 +100,7 @@ compose_corners(cube_t c1, cube_t c2) | |||
| 100 | STATIC_INLINE cube_t | 100 | STATIC_INLINE cube_t |
| 101 | compose(cube_t c1, cube_t c2) | 101 | compose(cube_t c1, cube_t c2) |
| 102 | { | 102 | { |
| 103 | cube_t ret = zero; | 103 | cube_t ret = ZERO_CUBE; |
| 104 | 104 | ||
| 105 | compose_edges_inplace(c1, c2, &ret); | 105 | compose_edges_inplace(c1, c2, &ret); |
| 106 | compose_corners_inplace(c1, c2, &ret); | 106 | compose_corners_inplace(c1, c2, &ret); |
| @@ -244,7 +244,7 @@ invcoord_esep(int64_t esep) | |||
| 244 | { | 244 | { |
| 245 | cube_t ret; | 245 | cube_t ret; |
| 246 | 246 | ||
| 247 | ret = solved; | 247 | ret = SOLVED_CUBE; |
| 248 | invcoord_esep_array(esep % 70, esep / 70, ret.edge); | 248 | invcoord_esep_array(esep % 70, esep / 70, ret.edge); |
| 249 | 249 | ||
| 250 | return ret; | 250 | return ret; |
diff --git a/src/core/constant_cubes.h b/src/core/constant_cubes.h index e6a9e88..9657e1a 100644 --- a/src/core/constant_cubes.h +++ b/src/core/constant_cubes.h | |||
| @@ -1,229 +1,229 @@ | |||
| 1 | #define MOVE_CUBE_U static_cube( \ | 1 | #define MOVE_CUBE_U STATIC_CUBE( \ |
| 2 | 5, 4, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3, 1, 0, 6, 7, 8, 9, 10, 11) | 2 | 5, 4, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3, 1, 0, 6, 7, 8, 9, 10, 11) |
| 3 | #define MOVE_CUBE_U2 static_cube( \ | 3 | #define MOVE_CUBE_U2 STATIC_CUBE( \ |
| 4 | 1, 0, 2, 3, 5, 4, 6, 7, 1, 0, 2, 3, 5, 4, 6, 7, 8, 9, 10, 11) | 4 | 1, 0, 2, 3, 5, 4, 6, 7, 1, 0, 2, 3, 5, 4, 6, 7, 8, 9, 10, 11) |
| 5 | #define MOVE_CUBE_U3 static_cube( \ | 5 | #define MOVE_CUBE_U3 STATIC_CUBE( \ |
| 6 | 4, 5, 2, 3, 1, 0, 6, 7, 5, 4, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11) | 6 | 4, 5, 2, 3, 1, 0, 6, 7, 5, 4, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11) |
| 7 | #define MOVE_CUBE_D static_cube( \ | 7 | #define MOVE_CUBE_D STATIC_CUBE( \ |
| 8 | 0, 1, 7, 6, 4, 5, 2, 3, 0, 1, 7, 6, 4, 5, 2, 3, 8, 9, 10, 11) | 8 | 0, 1, 7, 6, 4, 5, 2, 3, 0, 1, 7, 6, 4, 5, 2, 3, 8, 9, 10, 11) |
| 9 | #define MOVE_CUBE_D2 static_cube( \ | 9 | #define MOVE_CUBE_D2 STATIC_CUBE( \ |
| 10 | 0, 1, 3, 2, 4, 5, 7, 6, 0, 1, 3, 2, 4, 5, 7, 6, 8, 9, 10, 11) | 10 | 0, 1, 3, 2, 4, 5, 7, 6, 0, 1, 3, 2, 4, 5, 7, 6, 8, 9, 10, 11) |
| 11 | #define MOVE_CUBE_D3 static_cube( \ | 11 | #define MOVE_CUBE_D3 STATIC_CUBE( \ |
| 12 | 0, 1, 6, 7, 4, 5, 3, 2, 0, 1, 6, 7, 4, 5, 3, 2, 8, 9, 10, 11) | 12 | 0, 1, 6, 7, 4, 5, 3, 2, 0, 1, 6, 7, 4, 5, 3, 2, 8, 9, 10, 11) |
| 13 | #define MOVE_CUBE_R static_cube( \ | 13 | #define MOVE_CUBE_R STATIC_CUBE( \ |
| 14 | 70, 1, 2, 69, 4, 32, 35, 7, 0, 1, 2, 3, 8, 5, 6, 11, 7, 9, 10, 4) | 14 | 70, 1, 2, 69, 4, 32, 35, 7, 0, 1, 2, 3, 8, 5, 6, 11, 7, 9, 10, 4) |
| 15 | #define MOVE_CUBE_R2 static_cube( \ | 15 | #define MOVE_CUBE_R2 STATIC_CUBE( \ |
| 16 | 3, 1, 2, 0, 4, 6, 5, 7, 0, 1, 2, 3, 7, 5, 6, 4, 11, 9, 10, 8) | 16 | 3, 1, 2, 0, 4, 6, 5, 7, 0, 1, 2, 3, 7, 5, 6, 4, 11, 9, 10, 8) |
| 17 | #define MOVE_CUBE_R3 static_cube( \ | 17 | #define MOVE_CUBE_R3 STATIC_CUBE( \ |
| 18 | 69, 1, 2, 70, 4, 35, 32, 7, 0, 1, 2, 3, 11, 5, 6, 8, 4, 9, 10, 7) | 18 | 69, 1, 2, 70, 4, 35, 32, 7, 0, 1, 2, 3, 11, 5, 6, 8, 4, 9, 10, 7) |
| 19 | #define MOVE_CUBE_L static_cube( \ | 19 | #define MOVE_CUBE_L STATIC_CUBE( \ |
| 20 | 0, 71, 68, 3, 33, 5, 6, 34, 0, 1, 2, 3, 4, 10, 9, 7, 8, 5, 6, 11) | 20 | 0, 71, 68, 3, 33, 5, 6, 34, 0, 1, 2, 3, 4, 10, 9, 7, 8, 5, 6, 11) |
| 21 | #define MOVE_CUBE_L2 static_cube( \ | 21 | #define MOVE_CUBE_L2 STATIC_CUBE( \ |
| 22 | 0, 2, 1, 3, 7, 5, 6, 4, 0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11) | 22 | 0, 2, 1, 3, 7, 5, 6, 4, 0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11) |
| 23 | #define MOVE_CUBE_L3 static_cube( \ | 23 | #define MOVE_CUBE_L3 STATIC_CUBE( \ |
| 24 | 0, 68, 71, 3, 34, 5, 6, 33, 0, 1, 2, 3, 4, 9, 10, 7, 8, 6, 5, 11) | 24 | 0, 68, 71, 3, 34, 5, 6, 33, 0, 1, 2, 3, 4, 9, 10, 7, 8, 6, 5, 11) |
| 25 | #define MOVE_CUBE_F static_cube( \ | 25 | #define MOVE_CUBE_F STATIC_CUBE( \ |
| 26 | 36, 1, 38, 3, 66, 5, 64, 7, 25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11) | 26 | 36, 1, 38, 3, 66, 5, 64, 7, 25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11) |
| 27 | #define MOVE_CUBE_F2 static_cube( \ | 27 | #define MOVE_CUBE_F2 STATIC_CUBE( \ |
| 28 | 2, 1, 0, 3, 6, 5, 4, 7, 3, 1, 2, 0, 4, 5, 6, 7, 9, 8, 10, 11) | 28 | 2, 1, 0, 3, 6, 5, 4, 7, 3, 1, 2, 0, 4, 5, 6, 7, 9, 8, 10, 11) |
| 29 | #define MOVE_CUBE_F3 static_cube( \ | 29 | #define MOVE_CUBE_F3 STATIC_CUBE( \ |
| 30 | 38, 1, 36, 3, 64, 5, 66, 7, 24, 1, 2, 25, 4, 5, 6, 7, 19, 16, 10, 11) | 30 | 38, 1, 36, 3, 64, 5, 66, 7, 24, 1, 2, 25, 4, 5, 6, 7, 19, 16, 10, 11) |
| 31 | #define MOVE_CUBE_B static_cube( \ | 31 | #define MOVE_CUBE_B STATIC_CUBE( \ |
| 32 | 0, 37, 2, 39, 4, 67, 6, 65, 0, 27, 26, 3, 4, 5, 6, 7, 8, 9, 17, 18) | 32 | 0, 37, 2, 39, 4, 67, 6, 65, 0, 27, 26, 3, 4, 5, 6, 7, 8, 9, 17, 18) |
| 33 | #define MOVE_CUBE_B2 static_cube( \ | 33 | #define MOVE_CUBE_B2 STATIC_CUBE( \ |
| 34 | 0, 3, 2, 1, 4, 7, 6, 5, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 11, 10) | 34 | 0, 3, 2, 1, 4, 7, 6, 5, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 11, 10) |
| 35 | #define MOVE_CUBE_B3 static_cube( \ | 35 | #define MOVE_CUBE_B3 STATIC_CUBE( \ |
| 36 | 0, 39, 2, 37, 4, 65, 6, 67, 0, 26, 27, 3, 4, 5, 6, 7, 8, 9, 18, 17) | 36 | 0, 39, 2, 37, 4, 65, 6, 67, 0, 26, 27, 3, 4, 5, 6, 7, 8, 9, 18, 17) |
| 37 | 37 | ||
| 38 | #define TRANS_CUBE_UFr static_cube( \ | 38 | #define TRANS_CUBE_UFr STATIC_CUBE( \ |
| 39 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) | 39 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) |
| 40 | #define TRANS_CUBE_UFr_INVERSE static_cube( \ | 40 | #define TRANS_CUBE_UFr_INVERSE STATIC_CUBE( \ |
| 41 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) | 41 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) |
| 42 | #define TRANS_CUBE_ULr static_cube( \ | 42 | #define TRANS_CUBE_ULr STATIC_CUBE( \ |
| 43 | 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24) | 43 | 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24) |
| 44 | #define TRANS_CUBE_ULr_INVERSE static_cube( \ | 44 | #define TRANS_CUBE_ULr_INVERSE STATIC_CUBE( \ |
| 45 | 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26) | 45 | 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26) |
| 46 | #define TRANS_CUBE_UBr static_cube( \ | 46 | #define TRANS_CUBE_UBr STATIC_CUBE( \ |
| 47 | 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9) | 47 | 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9) |
| 48 | #define TRANS_CUBE_UBr_INVERSE static_cube( \ | 48 | #define TRANS_CUBE_UBr_INVERSE STATIC_CUBE( \ |
| 49 | 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9) | 49 | 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9) |
| 50 | #define TRANS_CUBE_URr static_cube( \ | 50 | #define TRANS_CUBE_URr STATIC_CUBE( \ |
| 51 | 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26) | 51 | 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26) |
| 52 | #define TRANS_CUBE_URr_INVERSE static_cube( \ | 52 | #define TRANS_CUBE_URr_INVERSE STATIC_CUBE( \ |
| 53 | 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24) | 53 | 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24) |
| 54 | #define TRANS_CUBE_DFr static_cube( \ | 54 | #define TRANS_CUBE_DFr STATIC_CUBE( \ |
| 55 | 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10) | 55 | 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10) |
| 56 | #define TRANS_CUBE_DFr_INVERSE static_cube( \ | 56 | #define TRANS_CUBE_DFr_INVERSE STATIC_CUBE( \ |
| 57 | 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10) | 57 | 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10) |
| 58 | #define TRANS_CUBE_DLr static_cube( \ | 58 | #define TRANS_CUBE_DLr STATIC_CUBE( \ |
| 59 | 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27) | 59 | 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27) |
| 60 | #define TRANS_CUBE_DLr_INVERSE static_cube( \ | 60 | #define TRANS_CUBE_DLr_INVERSE STATIC_CUBE( \ |
| 61 | 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27) | 61 | 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27) |
| 62 | #define TRANS_CUBE_DBr static_cube( \ | 62 | #define TRANS_CUBE_DBr STATIC_CUBE( \ |
| 63 | 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8) | 63 | 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8) |
| 64 | #define TRANS_CUBE_DBr_INVERSE static_cube( \ | 64 | #define TRANS_CUBE_DBr_INVERSE STATIC_CUBE( \ |
| 65 | 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8) | 65 | 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8) |
| 66 | #define TRANS_CUBE_DRr static_cube( \ | 66 | #define TRANS_CUBE_DRr STATIC_CUBE( \ |
| 67 | 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25) | 67 | 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25) |
| 68 | #define TRANS_CUBE_DRr_INVERSE static_cube( \ | 68 | #define TRANS_CUBE_DRr_INVERSE STATIC_CUBE( \ |
| 69 | 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25) | 69 | 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25) |
| 70 | #define TRANS_CUBE_RUr static_cube( \ | 70 | #define TRANS_CUBE_RUr STATIC_CUBE( \ |
| 71 | 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3) | 71 | 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3) |
| 72 | #define TRANS_CUBE_RUr_INVERSE static_cube( \ | 72 | #define TRANS_CUBE_RUr_INVERSE STATIC_CUBE( \ |
| 73 | 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21) | 73 | 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21) |
| 74 | #define TRANS_CUBE_RFr static_cube( \ | 74 | #define TRANS_CUBE_RFr STATIC_CUBE( \ |
| 75 | 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18) | 75 | 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18) |
| 76 | #define TRANS_CUBE_RFr_INVERSE static_cube( \ | 76 | #define TRANS_CUBE_RFr_INVERSE STATIC_CUBE( \ |
| 77 | 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17) | 77 | 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17) |
| 78 | #define TRANS_CUBE_RDr static_cube( \ | 78 | #define TRANS_CUBE_RDr STATIC_CUBE( \ |
| 79 | 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1) | 79 | 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1) |
| 80 | #define TRANS_CUBE_RDr_INVERSE static_cube( \ | 80 | #define TRANS_CUBE_RDr_INVERSE STATIC_CUBE( \ |
| 81 | 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20) | 81 | 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20) |
| 82 | #define TRANS_CUBE_RBr static_cube( \ | 82 | #define TRANS_CUBE_RBr STATIC_CUBE( \ |
| 83 | 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16) | 83 | 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16) |
| 84 | #define TRANS_CUBE_RBr_INVERSE static_cube( \ | 84 | #define TRANS_CUBE_RBr_INVERSE STATIC_CUBE( \ |
| 85 | 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16) | 85 | 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16) |
| 86 | #define TRANS_CUBE_LUr static_cube( \ | 86 | #define TRANS_CUBE_LUr STATIC_CUBE( \ |
| 87 | 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2) | 87 | 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2) |
| 88 | #define TRANS_CUBE_LUr_INVERSE static_cube( \ | 88 | #define TRANS_CUBE_LUr_INVERSE STATIC_CUBE( \ |
| 89 | 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23) | 89 | 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23) |
| 90 | #define TRANS_CUBE_LFr static_cube( \ | 90 | #define TRANS_CUBE_LFr STATIC_CUBE( \ |
| 91 | 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17) | 91 | 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17) |
| 92 | #define TRANS_CUBE_LFr_INVERSE static_cube( \ | 92 | #define TRANS_CUBE_LFr_INVERSE STATIC_CUBE( \ |
| 93 | 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18) | 93 | 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18) |
| 94 | #define TRANS_CUBE_LDr static_cube( \ | 94 | #define TRANS_CUBE_LDr STATIC_CUBE( \ |
| 95 | 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0) | 95 | 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0) |
| 96 | #define TRANS_CUBE_LDr_INVERSE static_cube( \ | 96 | #define TRANS_CUBE_LDr_INVERSE STATIC_CUBE( \ |
| 97 | 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22) | 97 | 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22) |
| 98 | #define TRANS_CUBE_LBr static_cube( \ | 98 | #define TRANS_CUBE_LBr STATIC_CUBE( \ |
| 99 | 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19) | 99 | 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19) |
| 100 | #define TRANS_CUBE_LBr_INVERSE static_cube( \ | 100 | #define TRANS_CUBE_LBr_INVERSE STATIC_CUBE( \ |
| 101 | 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19) | 101 | 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19) |
| 102 | #define TRANS_CUBE_FUr static_cube( \ | 102 | #define TRANS_CUBE_FUr STATIC_CUBE( \ |
| 103 | 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6) | 103 | 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6) |
| 104 | #define TRANS_CUBE_FUr_INVERSE static_cube( \ | 104 | #define TRANS_CUBE_FUr_INVERSE STATIC_CUBE( \ |
| 105 | 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6) | 105 | 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6) |
| 106 | #define TRANS_CUBE_FRr static_cube( \ | 106 | #define TRANS_CUBE_FRr STATIC_CUBE( \ |
| 107 | 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21) | 107 | 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21) |
| 108 | #define TRANS_CUBE_FRr_INVERSE static_cube( \ | 108 | #define TRANS_CUBE_FRr_INVERSE STATIC_CUBE( \ |
| 109 | 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3) | 109 | 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3) |
| 110 | #define TRANS_CUBE_FDr static_cube( \ | 110 | #define TRANS_CUBE_FDr STATIC_CUBE( \ |
| 111 | 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4) | 111 | 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4) |
| 112 | #define TRANS_CUBE_FDr_INVERSE static_cube( \ | 112 | #define TRANS_CUBE_FDr_INVERSE STATIC_CUBE( \ |
| 113 | 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7) | 113 | 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7) |
| 114 | #define TRANS_CUBE_FLr static_cube( \ | 114 | #define TRANS_CUBE_FLr STATIC_CUBE( \ |
| 115 | 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23) | 115 | 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23) |
| 116 | #define TRANS_CUBE_FLr_INVERSE static_cube( \ | 116 | #define TRANS_CUBE_FLr_INVERSE STATIC_CUBE( \ |
| 117 | 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2) | 117 | 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2) |
| 118 | #define TRANS_CUBE_BUr static_cube( \ | 118 | #define TRANS_CUBE_BUr STATIC_CUBE( \ |
| 119 | 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7) | 119 | 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7) |
| 120 | #define TRANS_CUBE_BUr_INVERSE static_cube( \ | 120 | #define TRANS_CUBE_BUr_INVERSE STATIC_CUBE( \ |
| 121 | 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4) | 121 | 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4) |
| 122 | #define TRANS_CUBE_BRr static_cube( \ | 122 | #define TRANS_CUBE_BRr STATIC_CUBE( \ |
| 123 | 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22) | 123 | 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22) |
| 124 | #define TRANS_CUBE_BRr_INVERSE static_cube( \ | 124 | #define TRANS_CUBE_BRr_INVERSE STATIC_CUBE( \ |
| 125 | 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0) | 125 | 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0) |
| 126 | #define TRANS_CUBE_BDr static_cube( \ | 126 | #define TRANS_CUBE_BDr STATIC_CUBE( \ |
| 127 | 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5) | 127 | 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5) |
| 128 | #define TRANS_CUBE_BDr_INVERSE static_cube( \ | 128 | #define TRANS_CUBE_BDr_INVERSE STATIC_CUBE( \ |
| 129 | 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5) | 129 | 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5) |
| 130 | #define TRANS_CUBE_BLr static_cube( \ | 130 | #define TRANS_CUBE_BLr STATIC_CUBE( \ |
| 131 | 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20) | 131 | 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20) |
| 132 | #define TRANS_CUBE_BLr_INVERSE static_cube( \ | 132 | #define TRANS_CUBE_BLr_INVERSE STATIC_CUBE( \ |
| 133 | 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1) | 133 | 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1) |
| 134 | #define TRANS_CUBE_UFm static_cube( \ | 134 | #define TRANS_CUBE_UFm STATIC_CUBE( \ |
| 135 | 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10) | 135 | 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10) |
| 136 | #define TRANS_CUBE_UFm_INVERSE static_cube( \ | 136 | #define TRANS_CUBE_UFm_INVERSE STATIC_CUBE( \ |
| 137 | 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10) | 137 | 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10) |
| 138 | #define TRANS_CUBE_ULm static_cube( \ | 138 | #define TRANS_CUBE_ULm STATIC_CUBE( \ |
| 139 | 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25) | 139 | 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25) |
| 140 | #define TRANS_CUBE_ULm_INVERSE static_cube( \ | 140 | #define TRANS_CUBE_ULm_INVERSE STATIC_CUBE( \ |
| 141 | 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25) | 141 | 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25) |
| 142 | #define TRANS_CUBE_UBm static_cube( \ | 142 | #define TRANS_CUBE_UBm STATIC_CUBE( \ |
| 143 | 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8) | 143 | 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8) |
| 144 | #define TRANS_CUBE_UBm_INVERSE static_cube( \ | 144 | #define TRANS_CUBE_UBm_INVERSE STATIC_CUBE( \ |
| 145 | 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8) | 145 | 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8) |
| 146 | #define TRANS_CUBE_URm static_cube( \ | 146 | #define TRANS_CUBE_URm STATIC_CUBE( \ |
| 147 | 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27) | 147 | 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27) |
| 148 | #define TRANS_CUBE_URm_INVERSE static_cube( \ | 148 | #define TRANS_CUBE_URm_INVERSE STATIC_CUBE( \ |
| 149 | 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27) | 149 | 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27) |
| 150 | #define TRANS_CUBE_DFm static_cube( \ | 150 | #define TRANS_CUBE_DFm STATIC_CUBE( \ |
| 151 | 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11) | 151 | 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11) |
| 152 | #define TRANS_CUBE_DFm_INVERSE static_cube( \ | 152 | #define TRANS_CUBE_DFm_INVERSE STATIC_CUBE( \ |
| 153 | 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11) | 153 | 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11) |
| 154 | #define TRANS_CUBE_DLm static_cube( \ | 154 | #define TRANS_CUBE_DLm STATIC_CUBE( \ |
| 155 | 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26) | 155 | 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26) |
| 156 | #define TRANS_CUBE_DLm_INVERSE static_cube( \ | 156 | #define TRANS_CUBE_DLm_INVERSE STATIC_CUBE( \ |
| 157 | 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24) | 157 | 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24) |
| 158 | #define TRANS_CUBE_DBm static_cube( \ | 158 | #define TRANS_CUBE_DBm STATIC_CUBE( \ |
| 159 | 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9) | 159 | 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9) |
| 160 | #define TRANS_CUBE_DBm_INVERSE static_cube( \ | 160 | #define TRANS_CUBE_DBm_INVERSE STATIC_CUBE( \ |
| 161 | 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9) | 161 | 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9) |
| 162 | #define TRANS_CUBE_DRm static_cube( \ | 162 | #define TRANS_CUBE_DRm STATIC_CUBE( \ |
| 163 | 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24) | 163 | 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24) |
| 164 | #define TRANS_CUBE_DRm_INVERSE static_cube( \ | 164 | #define TRANS_CUBE_DRm_INVERSE STATIC_CUBE( \ |
| 165 | 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26) | 165 | 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26) |
| 166 | #define TRANS_CUBE_RUm static_cube( \ | 166 | #define TRANS_CUBE_RUm STATIC_CUBE( \ |
| 167 | 68, 71, 69, 70, 33, 34, 32, 35, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3) | 167 | 68, 71, 69, 70, 33, 34, 32, 35, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3) |
| 168 | #define TRANS_CUBE_RUm_INVERSE static_cube( \ | 168 | #define TRANS_CUBE_RUm_INVERSE STATIC_CUBE( \ |
| 169 | 70, 68, 69, 71, 32, 34, 35, 33, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22) | 169 | 70, 68, 69, 71, 32, 34, 35, 33, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22) |
| 170 | #define TRANS_CUBE_RFm static_cube( \ | 170 | #define TRANS_CUBE_RFm STATIC_CUBE( \ |
| 171 | 34, 33, 32, 35, 68, 71, 70, 69, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18) | 171 | 34, 33, 32, 35, 68, 71, 70, 69, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18) |
| 172 | #define TRANS_CUBE_RFm_INVERSE static_cube( \ | 172 | #define TRANS_CUBE_RFm_INVERSE STATIC_CUBE( \ |
| 173 | 66, 65, 64, 67, 36, 39, 38, 37, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18) | 173 | 66, 65, 64, 67, 36, 39, 38, 37, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18) |
| 174 | #define TRANS_CUBE_RDm static_cube( \ | 174 | #define TRANS_CUBE_RDm STATIC_CUBE( \ |
| 175 | 71, 68, 70, 69, 34, 33, 35, 32, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1) | 175 | 71, 68, 70, 69, 34, 33, 35, 32, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1) |
| 176 | #define TRANS_CUBE_RDm_INVERSE static_cube( \ | 176 | #define TRANS_CUBE_RDm_INVERSE STATIC_CUBE( \ |
| 177 | 71, 69, 68, 70, 33, 35, 34, 32, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23) | 177 | 71, 69, 68, 70, 33, 35, 34, 32, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23) |
| 178 | #define TRANS_CUBE_RBm static_cube( \ | 178 | #define TRANS_CUBE_RBm STATIC_CUBE( \ |
| 179 | 33, 34, 35, 32, 71, 68, 69, 70, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16) | 179 | 33, 34, 35, 32, 71, 68, 69, 70, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16) |
| 180 | #define TRANS_CUBE_RBm_INVERSE static_cube( \ | 180 | #define TRANS_CUBE_RBm_INVERSE STATIC_CUBE( \ |
| 181 | 67, 64, 65, 66, 37, 38, 39, 36, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19) | 181 | 67, 64, 65, 66, 37, 38, 39, 36, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19) |
| 182 | #define TRANS_CUBE_LUm static_cube( \ | 182 | #define TRANS_CUBE_LUm STATIC_CUBE( \ |
| 183 | 69, 70, 68, 71, 32, 35, 33, 34, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2) | 183 | 69, 70, 68, 71, 32, 35, 33, 34, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2) |
| 184 | #define TRANS_CUBE_LUm_INVERSE static_cube( \ | 184 | #define TRANS_CUBE_LUm_INVERSE STATIC_CUBE( \ |
| 185 | 68, 70, 71, 69, 34, 32, 33, 35, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20) | 185 | 68, 70, 71, 69, 34, 32, 33, 35, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20) |
| 186 | #define TRANS_CUBE_LFm static_cube( \ | 186 | #define TRANS_CUBE_LFm STATIC_CUBE( \ |
| 187 | 32, 35, 34, 33, 70, 69, 68, 71, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17) | 187 | 32, 35, 34, 33, 70, 69, 68, 71, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17) |
| 188 | #define TRANS_CUBE_LFm_INVERSE static_cube( \ | 188 | #define TRANS_CUBE_LFm_INVERSE STATIC_CUBE( \ |
| 189 | 64, 67, 66, 65, 38, 37, 36, 39, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17) | 189 | 64, 67, 66, 65, 38, 37, 36, 39, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17) |
| 190 | #define TRANS_CUBE_LDm static_cube( \ | 190 | #define TRANS_CUBE_LDm STATIC_CUBE( \ |
| 191 | 70, 69, 71, 68, 35, 32, 34, 33, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0) | 191 | 70, 69, 71, 68, 35, 32, 34, 33, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0) |
| 192 | #define TRANS_CUBE_LDm_INVERSE static_cube( \ | 192 | #define TRANS_CUBE_LDm_INVERSE STATIC_CUBE( \ |
| 193 | 69, 71, 70, 68, 35, 33, 32, 34, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21) | 193 | 69, 71, 70, 68, 35, 33, 32, 34, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21) |
| 194 | #define TRANS_CUBE_LBm static_cube( \ | 194 | #define TRANS_CUBE_LBm STATIC_CUBE( \ |
| 195 | 35, 32, 33, 34, 69, 70, 71, 68, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19) | 195 | 35, 32, 33, 34, 69, 70, 71, 68, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19) |
| 196 | #define TRANS_CUBE_LBm_INVERSE static_cube( \ | 196 | #define TRANS_CUBE_LBm_INVERSE STATIC_CUBE( \ |
| 197 | 65, 66, 67, 64, 39, 36, 37, 38, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16) | 197 | 65, 66, 67, 64, 39, 36, 37, 38, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16) |
| 198 | #define TRANS_CUBE_FUm static_cube( \ | 198 | #define TRANS_CUBE_FUm STATIC_CUBE( \ |
| 199 | 64, 66, 65, 67, 36, 38, 37, 39, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7) | 199 | 64, 66, 65, 67, 36, 38, 37, 39, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7) |
| 200 | #define TRANS_CUBE_FUm_INVERSE static_cube( \ | 200 | #define TRANS_CUBE_FUm_INVERSE STATIC_CUBE( \ |
| 201 | 32, 34, 33, 35, 68, 70, 69, 71, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7) | 201 | 32, 34, 33, 35, 68, 70, 69, 71, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7) |
| 202 | #define TRANS_CUBE_FRm static_cube( \ | 202 | #define TRANS_CUBE_FRm STATIC_CUBE( \ |
| 203 | 36, 38, 39, 37, 66, 64, 65, 67, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20) | 203 | 36, 38, 39, 37, 66, 64, 65, 67, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20) |
| 204 | #define TRANS_CUBE_FRm_INVERSE static_cube( \ | 204 | #define TRANS_CUBE_FRm_INVERSE STATIC_CUBE( \ |
| 205 | 37, 38, 36, 39, 64, 67, 65, 66, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2) | 205 | 37, 38, 36, 39, 64, 67, 65, 66, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2) |
| 206 | #define TRANS_CUBE_FDm static_cube( \ | 206 | #define TRANS_CUBE_FDm STATIC_CUBE( \ |
| 207 | 66, 64, 67, 65, 38, 36, 39, 37, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5) | 207 | 66, 64, 67, 65, 38, 36, 39, 37, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5) |
| 208 | #define TRANS_CUBE_FDm_INVERSE static_cube( \ | 208 | #define TRANS_CUBE_FDm_INVERSE STATIC_CUBE( \ |
| 209 | 33, 35, 32, 34, 69, 71, 68, 70, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6) | 209 | 33, 35, 32, 34, 69, 71, 68, 70, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6) |
| 210 | #define TRANS_CUBE_FLm static_cube( \ | 210 | #define TRANS_CUBE_FLm STATIC_CUBE( \ |
| 211 | 38, 36, 37, 39, 64, 66, 67, 65, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22) | 211 | 38, 36, 37, 39, 64, 66, 67, 65, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22) |
| 212 | #define TRANS_CUBE_FLm_INVERSE static_cube( \ | 212 | #define TRANS_CUBE_FLm_INVERSE STATIC_CUBE( \ |
| 213 | 36, 39, 37, 38, 65, 66, 64, 67, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3) | 213 | 36, 39, 37, 38, 65, 66, 64, 67, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3) |
| 214 | #define TRANS_CUBE_BUm static_cube( \ | 214 | #define TRANS_CUBE_BUm STATIC_CUBE( \ |
| 215 | 65, 67, 64, 66, 37, 39, 36, 38, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6) | 215 | 65, 67, 64, 66, 37, 39, 36, 38, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6) |
| 216 | #define TRANS_CUBE_BUm_INVERSE static_cube( \ | 216 | #define TRANS_CUBE_BUm_INVERSE STATIC_CUBE( \ |
| 217 | 34, 32, 35, 33, 70, 68, 71, 69, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5) | 217 | 34, 32, 35, 33, 70, 68, 71, 69, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5) |
| 218 | #define TRANS_CUBE_BRm static_cube( \ | 218 | #define TRANS_CUBE_BRm STATIC_CUBE( \ |
| 219 | 39, 37, 36, 38, 65, 67, 66, 64, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23) | 219 | 39, 37, 36, 38, 65, 67, 66, 64, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23) |
| 220 | #define TRANS_CUBE_BRm_INVERSE static_cube( \ | 220 | #define TRANS_CUBE_BRm_INVERSE STATIC_CUBE( \ |
| 221 | 39, 36, 38, 37, 66, 65, 67, 64, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1) | 221 | 39, 36, 38, 37, 66, 65, 67, 64, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1) |
| 222 | #define TRANS_CUBE_BDm static_cube( \ | 222 | #define TRANS_CUBE_BDm STATIC_CUBE( \ |
| 223 | 67, 65, 66, 64, 39, 37, 38, 36, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4) | 223 | 67, 65, 66, 64, 39, 37, 38, 36, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4) |
| 224 | #define TRANS_CUBE_BDm_INVERSE static_cube( \ | 224 | #define TRANS_CUBE_BDm_INVERSE STATIC_CUBE( \ |
| 225 | 35, 33, 34, 32, 71, 69, 70, 68, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4) | 225 | 35, 33, 34, 32, 71, 69, 70, 68, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4) |
| 226 | #define TRANS_CUBE_BLm static_cube( \ | 226 | #define TRANS_CUBE_BLm STATIC_CUBE( \ |
| 227 | 37, 39, 38, 36, 67, 65, 64, 66, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21) | 227 | 37, 39, 38, 36, 67, 65, 64, 66, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21) |
| 228 | #define TRANS_CUBE_BLm_INVERSE static_cube( \ | 228 | #define TRANS_CUBE_BLm_INVERSE STATIC_CUBE( \ |
| 229 | 38, 37, 39, 36, 67, 64, 66, 65, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0) | 229 | 38, 37, 39, 36, 67, 64, 66, 65, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0) |
diff --git a/src/core/cube.h b/src/core/cube.h index 1bb8bd0..2252a85 100644 --- a/src/core/cube.h +++ b/src/core/cube.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | STATIC cube_t solvecube(void); | ||
| 1 | STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]); | 2 | STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]); |
| 2 | STATIC cube_t solvedcube(void); | ||
| 3 | STATIC bool isconsistent(cube_t); | 3 | STATIC bool isconsistent(cube_t); |
| 4 | STATIC bool issolvable(cube_t); | 4 | STATIC bool issolvable(cube_t); |
| 5 | STATIC bool issolved(cube_t); | 5 | STATIC bool issolved(cube_t); |
| @@ -7,19 +7,20 @@ STATIC bool iserror(cube_t); | |||
| 7 | STATIC void getcube_fix(int64_t *, int64_t *, int64_t *, int64_t *); | 7 | STATIC void getcube_fix(int64_t *, int64_t *, int64_t *, int64_t *); |
| 8 | STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t); | 8 | STATIC cube_t getcube(int64_t, int64_t, int64_t, int64_t); |
| 9 | 9 | ||
| 10 | /* This is used only in tests, use SOLVED_CUBE directly everywhere else */ | ||
| 10 | STATIC cube_t | 11 | STATIC cube_t |
| 11 | cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) | 12 | solvedcube(void) |
| 12 | { | 13 | { |
| 13 | return static_cube( | 14 | return SOLVED_CUBE; |
| 14 | c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], | ||
| 15 | e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], | ||
| 16 | e[8], e[9], e[10], e[11]); | ||
| 17 | } | 15 | } |
| 18 | 16 | ||
| 19 | STATIC cube_t | 17 | STATIC cube_t |
| 20 | solvedcube(void) | 18 | cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) |
| 21 | { | 19 | { |
| 22 | return solved; | 20 | return STATIC_CUBE( |
| 21 | c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], | ||
| 22 | e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], | ||
| 23 | e[8], e[9], e[10], e[11]); | ||
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | STATIC bool | 26 | STATIC bool |
| @@ -127,13 +128,13 @@ issolvable_co: | |||
| 127 | bool | 128 | bool |
| 128 | issolved(cube_t cube) | 129 | issolved(cube_t cube) |
| 129 | { | 130 | { |
| 130 | return equal(cube, solved); | 131 | return equal(cube, SOLVED_CUBE); |
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | bool | 134 | bool |
| 134 | iserror(cube_t cube) | 135 | iserror(cube_t cube) |
| 135 | { | 136 | { |
| 136 | return equal(cube, zero); | 137 | return equal(cube, ZERO_CUBE); |
| 137 | } | 138 | } |
| 138 | 139 | ||
| 139 | STATIC void | 140 | STATIC void |
| @@ -149,11 +150,11 @@ getcube_fix(int64_t *ep, int64_t *eo, int64_t *cp, int64_t *co) | |||
| 149 | indextoperm(*ep, 12, e); | 150 | indextoperm(*ep, 12, e); |
| 150 | indextoperm(*cp, 8, c); | 151 | indextoperm(*cp, 8, c); |
| 151 | if (permsign(e, 12) != permsign(c, 8)) { | 152 | if (permsign(e, 12) != permsign(c, 8)) { |
| 152 | _swap(c[0], c[1]); | 153 | SWAP(c[0], c[1]); |
| 153 | *cp = permtoindex(c, 8); | 154 | *cp = permtoindex(c, 8); |
| 154 | 155 | ||
| 155 | sumzerotodigits(*co, 8, 3, coarr); | 156 | sumzerotodigits(*co, 8, 3, coarr); |
| 156 | _swap(coarr[0], coarr[1]); | 157 | SWAP(coarr[0], coarr[1]); |
| 157 | *co = digitstosumzero(coarr, 8, 3); | 158 | *co = digitstosumzero(coarr, 8, 3); |
| 158 | } | 159 | } |
| 159 | } | 160 | } |
| @@ -164,16 +165,16 @@ getcube(int64_t ep, int64_t eo, int64_t cp, int64_t co) | |||
| 164 | uint8_t i, earr[12], carr[8], eoarr[12], coarr[8]; | 165 | uint8_t i, earr[12], carr[8], eoarr[12], coarr[8]; |
| 165 | 166 | ||
| 166 | sumzerotodigits(eo, 12, 2, eoarr); | 167 | sumzerotodigits(eo, 12, 2, eoarr); |
| 167 | DBG_ASSERT(eoarr[0] != UINT8_ERROR, zero, "Error making EO"); | 168 | DBG_ASSERT(eoarr[0] != UINT8_ERROR, ZERO_CUBE, "Error making EO"); |
| 168 | indextoperm(ep, 12, earr); | 169 | indextoperm(ep, 12, earr); |
| 169 | DBG_ASSERT(earr[0] != UINT8_ERROR, zero, "Error making EP"); | 170 | DBG_ASSERT(earr[0] != UINT8_ERROR, ZERO_CUBE, "Error making EP"); |
| 170 | for (i = 0; i < 12; i++) | 171 | for (i = 0; i < 12; i++) |
| 171 | earr[i] |= eoarr[i] << EOSHIFT; | 172 | earr[i] |= eoarr[i] << EOSHIFT; |
| 172 | 173 | ||
| 173 | sumzerotodigits(co, 8, 3, coarr); | 174 | sumzerotodigits(co, 8, 3, coarr); |
| 174 | DBG_ASSERT(coarr[0] != UINT8_ERROR, zero, "Error making CO"); | 175 | DBG_ASSERT(coarr[0] != UINT8_ERROR, ZERO_CUBE, "Error making CO"); |
| 175 | indextoperm(cp, 8, carr); | 176 | indextoperm(cp, 8, carr); |
| 176 | DBG_ASSERT(carr[0] != UINT8_ERROR, zero, "Error making CP"); | 177 | DBG_ASSERT(carr[0] != UINT8_ERROR, ZERO_CUBE, "Error making CP"); |
| 177 | for (i = 0; i < 8; i++) | 178 | for (i = 0; i < 8; i++) |
| 178 | carr[i] |= coarr[i] << COSHIFT; | 179 | carr[i] |= coarr[i] << COSHIFT; |
| 179 | 180 | ||
diff --git a/src/core/io_cube.h b/src/core/io_cube.h index cb0e4c7..9ae82d7 100644 --- a/src/core/io_cube.h +++ b/src/core/io_cube.h | |||
| @@ -39,7 +39,7 @@ readcube(const char *format, const char *buf) | |||
| 39 | return ioformat[i].read(buf); | 39 | return ioformat[i].read(buf); |
| 40 | 40 | ||
| 41 | LOG("Cannot read cube in the given format\n"); | 41 | LOG("Cannot read cube in the given format\n"); |
| 42 | return zero; | 42 | return ZERO_CUBE; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void | 45 | void |
| @@ -133,13 +133,13 @@ readcube_B32(const char *buf) | |||
| 133 | 133 | ||
| 134 | for (i = 0; i < 8; i++) { | 134 | for (i = 0; i < 8; i++) { |
| 135 | c[i] = b32tocorner(buf[i]); | 135 | c[i] = b32tocorner(buf[i]); |
| 136 | DBG_ASSERT(c[i] < 255, zero, | 136 | DBG_ASSERT(c[i] < 255, ZERO_CUBE, |
| 137 | "Error reading B32 corner %d (char %d)\n", i, i); | 137 | "Error reading B32 corner %d (char %d)\n", i, i); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | for (i = 0; i < 12; i++) { | 140 | for (i = 0; i < 12; i++) { |
| 141 | e[i] = b32toedge(buf[i+9]); | 141 | e[i] = b32toedge(buf[i+9]); |
| 142 | DBG_ASSERT(e[i] < 255, zero, | 142 | DBG_ASSERT(e[i] < 255, ZERO_CUBE, |
| 143 | "Error reading B32 edge %d (char %d)\n", i, i+9); | 143 | "Error reading B32 edge %d (char %d)\n", i, i+9); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| @@ -159,10 +159,10 @@ readcube_H48(const char *buf) | |||
| 159 | while (*b == ' ' || *b == '\t' || *b == '\n') | 159 | while (*b == ' ' || *b == '\t' || *b == '\n') |
| 160 | b++; | 160 | b++; |
| 161 | if ((piece = readep(b)) == UINT8_ERROR) | 161 | if ((piece = readep(b)) == UINT8_ERROR) |
| 162 | return zero; | 162 | return ZERO_CUBE; |
| 163 | b += 2; | 163 | b += 2; |
| 164 | if ((orient = readeo(b)) == UINT8_ERROR) | 164 | if ((orient = readeo(b)) == UINT8_ERROR) |
| 165 | return zero; | 165 | return ZERO_CUBE; |
| 166 | b++; | 166 | b++; |
| 167 | e[i] = piece | orient; | 167 | e[i] = piece | orient; |
| 168 | } | 168 | } |
| @@ -170,10 +170,10 @@ readcube_H48(const char *buf) | |||
| 170 | while (*b == ' ' || *b == '\t' || *b == '\n') | 170 | while (*b == ' ' || *b == '\t' || *b == '\n') |
| 171 | b++; | 171 | b++; |
| 172 | if ((piece = readcp(b)) == UINT8_ERROR) | 172 | if ((piece = readcp(b)) == UINT8_ERROR) |
| 173 | return zero; | 173 | return ZERO_CUBE; |
| 174 | b += 3; | 174 | b += 3; |
| 175 | if ((orient = readco(b)) == UINT8_ERROR) | 175 | if ((orient = readco(b)) == UINT8_ERROR) |
| 176 | return zero; | 176 | return ZERO_CUBE; |
| 177 | b++; | 177 | b++; |
| 178 | c[i] = piece | orient; | 178 | c[i] = piece | orient; |
| 179 | } | 179 | } |
diff --git a/src/core/moves.h b/src/core/moves.h index 45cd804..b542235 100644 --- a/src/core/moves.h +++ b/src/core/moves.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #define _move(M, c) compose(c, MOVE_CUBE_ ## M) | 1 | #define MOVE(M, c) compose(c, MOVE_CUBE_ ## M) |
| 2 | #define _premove(M, c) compose(MOVE_CUBE_ ## M, c) | 2 | #define PREMOVE(M, c) compose(MOVE_CUBE_ ## M, c) |
| 3 | 3 | ||
| 4 | STATIC_INLINE bool allowednextmove(uint8_t *, uint8_t); | 4 | STATIC_INLINE bool allowednextmove(uint8_t *, uint8_t); |
| 5 | 5 | ||
| @@ -70,44 +70,44 @@ move(cube_t c, uint8_t m) | |||
| 70 | { | 70 | { |
| 71 | switch (m) { | 71 | switch (m) { |
| 72 | case MOVE_U: | 72 | case MOVE_U: |
| 73 | return _move(U, c); | 73 | return MOVE(U, c); |
| 74 | case MOVE_U2: | 74 | case MOVE_U2: |
| 75 | return _move(U2, c); | 75 | return MOVE(U2, c); |
| 76 | case MOVE_U3: | 76 | case MOVE_U3: |
| 77 | return _move(U3, c); | 77 | return MOVE(U3, c); |
| 78 | case MOVE_D: | 78 | case MOVE_D: |
| 79 | return _move(D, c); | 79 | return MOVE(D, c); |
| 80 | case MOVE_D2: | 80 | case MOVE_D2: |
| 81 | return _move(D2, c); | 81 | return MOVE(D2, c); |
| 82 | case MOVE_D3: | 82 | case MOVE_D3: |
| 83 | return _move(D3, c); | 83 | return MOVE(D3, c); |
| 84 | case MOVE_R: | 84 | case MOVE_R: |
| 85 | return _move(R, c); | 85 | return MOVE(R, c); |
| 86 | case MOVE_R2: | 86 | case MOVE_R2: |
| 87 | return _move(R2, c); | 87 | return MOVE(R2, c); |
| 88 | case MOVE_R3: | 88 | case MOVE_R3: |
| 89 | return _move(R3, c); | 89 | return MOVE(R3, c); |
| 90 | case MOVE_L: | 90 | case MOVE_L: |
| 91 | return _move(L, c); | 91 | return MOVE(L, c); |
| 92 | case MOVE_L2: | 92 | case MOVE_L2: |
| 93 | return _move(L2, c); | 93 | return MOVE(L2, c); |
| 94 | case MOVE_L3: | 94 | case MOVE_L3: |
| 95 | return _move(L3, c); | 95 | return MOVE(L3, c); |
| 96 | case MOVE_F: | 96 | case MOVE_F: |
| 97 | return _move(F, c); | 97 | return MOVE(F, c); |
| 98 | case MOVE_F2: | 98 | case MOVE_F2: |
| 99 | return _move(F2, c); | 99 | return MOVE(F2, c); |
| 100 | case MOVE_F3: | 100 | case MOVE_F3: |
| 101 | return _move(F3, c); | 101 | return MOVE(F3, c); |
| 102 | case MOVE_B: | 102 | case MOVE_B: |
| 103 | return _move(B, c); | 103 | return MOVE(B, c); |
| 104 | case MOVE_B2: | 104 | case MOVE_B2: |
| 105 | return _move(B2, c); | 105 | return MOVE(B2, c); |
| 106 | case MOVE_B3: | 106 | case MOVE_B3: |
| 107 | return _move(B3, c); | 107 | return MOVE(B3, c); |
| 108 | default: | 108 | default: |
| 109 | LOG("move error, unknown move\n"); | 109 | LOG("move error, unknown move\n"); |
| 110 | return zero; | 110 | return ZERO_CUBE; |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | 113 | ||
| @@ -116,44 +116,44 @@ premove(cube_t c, uint8_t m) | |||
| 116 | { | 116 | { |
| 117 | switch (m) { | 117 | switch (m) { |
| 118 | case MOVE_U: | 118 | case MOVE_U: |
| 119 | return _premove(U3, c); | 119 | return PREMOVE(U3, c); |
| 120 | case MOVE_U2: | 120 | case MOVE_U2: |
| 121 | return _premove(U2, c); | 121 | return PREMOVE(U2, c); |
| 122 | case MOVE_U3: | 122 | case MOVE_U3: |
| 123 | return _premove(U, c); | 123 | return PREMOVE(U, c); |
| 124 | case MOVE_D: | 124 | case MOVE_D: |
| 125 | return _premove(D3, c); | 125 | return PREMOVE(D3, c); |
| 126 | case MOVE_D2: | 126 | case MOVE_D2: |
| 127 | return _premove(D2, c); | 127 | return PREMOVE(D2, c); |
| 128 | case MOVE_D3: | 128 | case MOVE_D3: |
| 129 | return _premove(D, c); | 129 | return PREMOVE(D, c); |
| 130 | case MOVE_R: | 130 | case MOVE_R: |
| 131 | return _premove(R3, c); | 131 | return PREMOVE(R3, c); |
| 132 | case MOVE_R2: | 132 | case MOVE_R2: |
| 133 | return _premove(R2, c); | 133 | return PREMOVE(R2, c); |
| 134 | case MOVE_R3: | 134 | case MOVE_R3: |
| 135 | return _premove(R, c); | 135 | return PREMOVE(R, c); |
| 136 | case MOVE_L: | 136 | case MOVE_L: |
| 137 | return _premove(L3, c); | 137 | return PREMOVE(L3, c); |
| 138 | case MOVE_L2: | 138 | case MOVE_L2: |
| 139 | return _premove(L2, c); | 139 | return PREMOVE(L2, c); |
| 140 | case MOVE_L3: | 140 | case MOVE_L3: |
| 141 | return _premove(L, c); | 141 | return PREMOVE(L, c); |
| 142 | case MOVE_F: | 142 | case MOVE_F: |
| 143 | return _premove(F3, c); | 143 | return PREMOVE(F3, c); |
| 144 | case MOVE_F2: | 144 | case MOVE_F2: |
| 145 | return _premove(F2, c); | 145 | return PREMOVE(F2, c); |
| 146 | case MOVE_F3: | 146 | case MOVE_F3: |
| 147 | return _premove(F, c); | 147 | return PREMOVE(F, c); |
| 148 | case MOVE_B: | 148 | case MOVE_B: |
| 149 | return _premove(B3, c); | 149 | return PREMOVE(B3, c); |
| 150 | case MOVE_B2: | 150 | case MOVE_B2: |
| 151 | return _premove(B2, c); | 151 | return PREMOVE(B2, c); |
| 152 | case MOVE_B3: | 152 | case MOVE_B3: |
| 153 | return _premove(B, c); | 153 | return PREMOVE(B, c); |
| 154 | default: | 154 | default: |
| 155 | LOG("move error, unknown move\n"); | 155 | LOG("move error, unknown move\n"); |
| 156 | return zero; | 156 | return ZERO_CUBE; |
| 157 | } | 157 | } |
| 158 | } | 158 | } |
| 159 | 159 | ||
| @@ -178,7 +178,7 @@ applymoves(cube_t cube, const char *buf) | |||
| 178 | uint8_t r, m; | 178 | uint8_t r, m; |
| 179 | const char *b; | 179 | const char *b; |
| 180 | 180 | ||
| 181 | DBG_ASSERT(isconsistent(cube), zero, | 181 | DBG_ASSERT(isconsistent(cube), ZERO_CUBE, |
| 182 | "move error: inconsistent cube\n"); | 182 | "move error: inconsistent cube\n"); |
| 183 | 183 | ||
| 184 | for (b = buf; *b != '\0'; b++) { | 184 | for (b = buf; *b != '\0'; b++) { |
| @@ -198,11 +198,11 @@ applymoves_finish: | |||
| 198 | 198 | ||
| 199 | applymoves_error: | 199 | applymoves_error: |
| 200 | LOG("applymoves error\n"); | 200 | LOG("applymoves error\n"); |
| 201 | return zero; | 201 | return ZERO_CUBE; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | STATIC cube_t | 204 | STATIC cube_t |
| 205 | frommoves(const char *buf) | 205 | frommoves(const char *buf) |
| 206 | { | 206 | { |
| 207 | return applymoves(solved, buf); | 207 | return applymoves(SOLVED_CUBE, buf); |
| 208 | } | 208 | } |
diff --git a/src/core/transform.h b/src/core/transform.h index a792c25..37de46b 100644 --- a/src/core/transform.h +++ b/src/core/transform.h | |||
| @@ -110,7 +110,7 @@ transform_edges(cube_t c, uint8_t t) | |||
| 110 | { | 110 | { |
| 111 | cube_t ret, trans_cube, trans_inv; | 111 | cube_t ret, trans_cube, trans_inv; |
| 112 | 112 | ||
| 113 | DBG_ASSERT(t < 48, zero, | 113 | DBG_ASSERT(t < 48, ZERO_CUBE, |
| 114 | "transform: invalid transformation %" PRIu8 | 114 | "transform: invalid transformation %" PRIu8 |
| 115 | ", must be between 0 and 47\n", t); | 115 | ", must be between 0 and 47\n", t); |
| 116 | 116 | ||
| @@ -128,7 +128,7 @@ transform_corners(cube_t c, uint8_t t) | |||
| 128 | { | 128 | { |
| 129 | cube_t ret, trans_cube, trans_inv; | 129 | cube_t ret, trans_cube, trans_inv; |
| 130 | 130 | ||
| 131 | DBG_ASSERT(t < 48, zero, | 131 | DBG_ASSERT(t < 48, ZERO_CUBE, |
| 132 | "transform: invalid transformation %" PRIu8 | 132 | "transform: invalid transformation %" PRIu8 |
| 133 | ", must be between 0 and 47\n", t); | 133 | ", must be between 0 and 47\n", t); |
| 134 | 134 | ||
| @@ -146,7 +146,7 @@ transform(cube_t c, uint8_t t) | |||
| 146 | { | 146 | { |
| 147 | cube_t ret, trans_cube, trans_inv; | 147 | cube_t ret, trans_cube, trans_inv; |
| 148 | 148 | ||
| 149 | DBG_ASSERT(t < 48, zero, | 149 | DBG_ASSERT(t < 48, ZERO_CUBE, |
| 150 | "transform: invalid transformation %" PRIu8 | 150 | "transform: invalid transformation %" PRIu8 |
| 151 | ", must be between 0 and 47\n", t); | 151 | ", must be between 0 and 47\n", t); |
| 152 | 152 | ||
| @@ -164,7 +164,7 @@ applytrans(cube_t cube, const char *buf) | |||
| 164 | { | 164 | { |
| 165 | uint8_t t; | 165 | uint8_t t; |
| 166 | 166 | ||
| 167 | DBG_ASSERT(isconsistent(cube), zero, | 167 | DBG_ASSERT(isconsistent(cube), ZERO_CUBE, |
| 168 | "transformation error: inconsistent cube\n"); | 168 | "transformation error: inconsistent cube\n"); |
| 169 | 169 | ||
| 170 | t = readtrans(buf); | 170 | t = readtrans(buf); |
diff --git a/src/core/transform_with_switch.h b/src/core/transform_with_switch.h index 3ffd9af..83204d5 100644 --- a/src/core/transform_with_switch.h +++ b/src/core/transform_with_switch.h | |||
| @@ -124,7 +124,7 @@ transform_edges(cube_t c, uint8_t t) | |||
| 124 | return TRANS_EDGES_MIRRORED(BLm, c); | 124 | return TRANS_EDGES_MIRRORED(BLm, c); |
| 125 | default: | 125 | default: |
| 126 | LOG("transform error, unknown transformation %" PRIu8 "\n", t); | 126 | LOG("transform error, unknown transformation %" PRIu8 "\n", t); |
| 127 | return zero; | 127 | return ZERO_CUBE; |
| 128 | } | 128 | } |
| 129 | } | 129 | } |
| 130 | 130 | ||
| @@ -230,7 +230,7 @@ transform_corners(cube_t c, uint8_t t) | |||
| 230 | return TRANS_CORNERS_MIRRORED(BLm, c); | 230 | return TRANS_CORNERS_MIRRORED(BLm, c); |
| 231 | default: | 231 | default: |
| 232 | LOG("transform error, unknown transformation %" PRIu8 "\n", t); | 232 | LOG("transform error, unknown transformation %" PRIu8 "\n", t); |
| 233 | return zero; | 233 | return ZERO_CUBE; |
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 236 | 236 | ||
| @@ -336,7 +336,7 @@ transform(cube_t c, uint8_t t) | |||
| 336 | return TRANS_MIRRORED(BLm, c); | 336 | return TRANS_MIRRORED(BLm, c); |
| 337 | default: | 337 | default: |
| 338 | LOG("transform error, unknown transformation %" PRIu8 "\n", t); | 338 | LOG("transform error, unknown transformation %" PRIu8 "\n", t); |
| 339 | return zero; | 339 | return ZERO_CUBE; |
| 340 | } | 340 | } |
| 341 | } | 341 | } |
| 342 | 342 | ||
| @@ -345,7 +345,7 @@ applytrans(cube_t cube, const char *buf) | |||
| 345 | { | 345 | { |
| 346 | uint8_t t; | 346 | uint8_t t; |
| 347 | 347 | ||
| 348 | DBG_ASSERT(isconsistent(cube), zero, | 348 | DBG_ASSERT(isconsistent(cube), ZERO_CUBE, |
| 349 | "transformation error: inconsistent cube\n"); | 349 | "transformation error: inconsistent cube\n"); |
| 350 | 350 | ||
| 351 | t = readtrans(buf); | 351 | t = readtrans(buf); |
diff --git a/src/nissy.c b/src/nissy.c index ac9a92c..de95e94 100644 --- a/src/nissy.c +++ b/src/nissy.c | |||
| @@ -65,7 +65,7 @@ STATIC int64_t | |||
| 65 | write_result(cube_t cube, char result[static 22]) | 65 | write_result(cube_t cube, char result[static 22]) |
| 66 | { | 66 | { |
| 67 | if (!isconsistent(cube)) { | 67 | if (!isconsistent(cube)) { |
| 68 | writecube("B32", zero, result); | 68 | writecube("B32", ZERO_CUBE, result); |
| 69 | return 2; | 69 | return 2; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| @@ -142,7 +142,7 @@ nissy_frommoves( | |||
| 142 | { | 142 | { |
| 143 | cube_t res; | 143 | cube_t res; |
| 144 | 144 | ||
| 145 | res = applymoves(solved, moves); | 145 | res = applymoves(SOLVED_CUBE, moves); |
| 146 | 146 | ||
| 147 | return write_result(res, result); | 147 | return write_result(res, result); |
| 148 | } | 148 | } |
diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h index 4da5575..25e13f9 100644 --- a/src/solvers/h48/coordinate.h +++ b/src/solvers/h48/coordinate.h | |||
| @@ -51,7 +51,7 @@ invcoord_h48(int64_t i, const cube_t *crep, uint8_t h) | |||
| 51 | cube_t ret; | 51 | cube_t ret; |
| 52 | int64_t hh, coclass, ee, esep, eo; | 52 | int64_t hh, coclass, ee, esep, eo; |
| 53 | 53 | ||
| 54 | DBG_ASSERT(h <= 11, zero, | 54 | DBG_ASSERT(h <= 11, ZERO_CUBE, |
| 55 | "invcoord_h48: h must be between 0 and 11\n"); | 55 | "invcoord_h48: h must be between 0 and 11\n"); |
| 56 | 56 | ||
| 57 | hh = (int64_t)h; | 57 | hh = (int64_t)h; |
diff --git a/src/solvers/h48/gendata_cocsep.h b/src/solvers/h48/gendata_cocsep.h index 54e092e..4a9b67e 100644 --- a/src/solvers/h48/gendata_cocsep.h +++ b/src/solvers/h48/gendata_cocsep.h | |||
| @@ -57,7 +57,7 @@ gendata_cocsep(void *buf, uint64_t *selfsim, cube_t *rep) | |||
| 57 | memset(selfsim, 0, sizeof(uint64_t) * COCSEP_CLASSES); | 57 | memset(selfsim, 0, sizeof(uint64_t) * COCSEP_CLASSES); |
| 58 | 58 | ||
| 59 | arg = (cocsep_dfs_arg_t) { | 59 | arg = (cocsep_dfs_arg_t) { |
| 60 | .cube = solved, | 60 | .cube = SOLVED_CUBE, |
| 61 | .n = &n, | 61 | .n = &n, |
| 62 | .buf32 = buf32, | 62 | .buf32 = buf32, |
| 63 | .visited = visited, | 63 | .visited = visited, |
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 0778b3c..51f49b8 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #define H48_COORDMAX_NOEO ((int64_t)(COCSEP_CLASSES * COMB_12_4 * COMB_8_4)) | 1 | #define H48_COORDMAX_NOEO ((int64_t)(COCSEP_CLASSES * COMB_12_4 * COMB_8_4)) |
| 2 | #define H48_COORDMAX(h) ((int64_t)(H48_COORDMAX_NOEO << (int64_t)(h))) | 2 | #define H48_COORDMAX(h) ((int64_t)(H48_COORDMAX_NOEO << (int64_t)(h))) |
| 3 | #define H48_DIV(k) ((size_t)8 / (size_t)(k)) | 3 | #define H48_DIV(k) ((size_t)8 / (size_t)(k)) |
| 4 | #define H48_TABLESIZE(h, k) _div_round_up((size_t)H48_COORDMAX((h)), H48_DIV(k)) | 4 | #define H48_TABLESIZE(h, k) DIV_ROUND_UP((size_t)H48_COORDMAX((h)), H48_DIV(k)) |
| 5 | 5 | ||
| 6 | #define H48_COEFF(k) (UINT32_C(32) / (uint32_t)(k)) | 6 | #define H48_COEFF(k) (UINT32_C(32) / (uint32_t)(k)) |
| 7 | #define H48_INDEX(i, k) ((uint32_t)(i) / H48_COEFF(k)) | 7 | #define H48_INDEX(i, k) ((uint32_t)(i) / H48_COEFF(k)) |
| @@ -97,7 +97,7 @@ gen_h48short(gendata_h48short_arg_t *arg) | |||
| 97 | kvpair_t kv; | 97 | kvpair_t kv; |
| 98 | cube_t cube, d; | 98 | cube_t cube, d; |
| 99 | 99 | ||
| 100 | cube = solvedcube(); | 100 | cube = SOLVED_CUBE; |
| 101 | coord = coord_h48(cube, arg->cocsepdata, 11); | 101 | coord = coord_h48(cube, arg->cocsepdata, 11); |
| 102 | h48map_insertmin(arg->map, coord, 0); | 102 | h48map_insertmin(arg->map, coord, 0); |
| 103 | oldn = 0; | 103 | oldn = 0; |
| @@ -175,7 +175,7 @@ gendata_h48h0k4(gendata_h48_arg_t *arg) | |||
| 175 | goto gendata_h48h0k4_return_size; | 175 | goto gendata_h48h0k4_return_size; |
| 176 | 176 | ||
| 177 | esep_max = (int64_t)H48_COORDMAX(0); | 177 | esep_max = (int64_t)H48_COORDMAX(0); |
| 178 | sc = coord_h48(solved, arg->cocsepdata, 0); | 178 | sc = coord_h48(SOLVED_CUBE, arg->cocsepdata, 0); |
| 179 | set_esep_pval(arg->h48data, sc, 4, 0); | 179 | set_esep_pval(arg->h48data, sc, 4, 0); |
| 180 | arg->info[1] = 1; | 180 | arg->info[1] = 1; |
| 181 | bfsarg = (h48h0k4_bfs_arg_t) { | 181 | bfsarg = (h48h0k4_bfs_arg_t) { |
| @@ -331,7 +331,7 @@ gendata_h48k2(gendata_h48_arg_t *arg) | |||
| 331 | .base = base[arg->h], | 331 | .base = base[arg->h], |
| 332 | .depth = shortdepth, | 332 | .depth = shortdepth, |
| 333 | .shortdepth = shortdepth, | 333 | .shortdepth = shortdepth, |
| 334 | .maxdepth = _min(arg->maxdepth, base[arg->h]+2), | 334 | .maxdepth = MIN(arg->maxdepth, base[arg->h]+2), |
| 335 | .cocsepdata = arg->cocsepdata, | 335 | .cocsepdata = arg->cocsepdata, |
| 336 | .h48data = arg->h48data, | 336 | .h48data = arg->h48data, |
| 337 | .selfsim = arg->selfsim, | 337 | .selfsim = arg->selfsim, |
| @@ -381,7 +381,7 @@ gendata_h48k2_dfs(h48k2_dfs_arg_t *arg) | |||
| 381 | oldval = get_esep_pval(arg->h48data, coord, arg->k); | 381 | oldval = get_esep_pval(arg->h48data, coord, arg->k); |
| 382 | newval = arg->depth >= arg->base ? arg->depth - arg->base : 0; | 382 | newval = arg->depth >= arg->base ? arg->depth - arg->base : 0; |
| 383 | set_esep_pval( | 383 | set_esep_pval( |
| 384 | arg->h48data, coord, arg->k, _min(oldval, newval)); | 384 | arg->h48data, coord, arg->k, MIN(oldval, newval)); |
| 385 | ) | 385 | ) |
| 386 | 386 | ||
| 387 | fullcoord = coord_h48(arg->cube, arg->cocsepdata, 11); /* Necessary? */ | 387 | fullcoord = coord_h48(arg->cube, arg->cocsepdata, 11); /* Necessary? */ |
diff --git a/src/solvers/h48/map.h b/src/solvers/h48/map.h index 34416fc..baffe39 100644 --- a/src/solvers/h48/map.h +++ b/src/solvers/h48/map.h | |||
| @@ -67,7 +67,7 @@ h48map_insertmin(h48map_t *map, uint64_t key, uint64_t val) | |||
| 67 | 67 | ||
| 68 | i = h48map_lookup(map, key); | 68 | i = h48map_lookup(map, key); |
| 69 | oldval = map->table[i] >> MAP_KEYSHIFT; | 69 | oldval = map->table[i] >> MAP_KEYSHIFT; |
| 70 | min = _min(val, oldval); | 70 | min = MIN(val, oldval); |
| 71 | 71 | ||
| 72 | map->n += map->table[i] == MAP_UNSET; | 72 | map->n += map->table[i] == MAP_UNSET; |
| 73 | map->table[i] = (key & MAP_KEYMASK) | (min << MAP_KEYSHIFT); | 73 | map->table[i] = (key & MAP_KEYMASK) | (min << MAP_KEYSHIFT); |
diff --git a/src/utils/math.h b/src/utils/math.h index e6c2589..1ab51e6 100644 --- a/src/utils/math.h +++ b/src/utils/math.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #define _swap(x, y) do { x ^= y; y ^= x; x ^= y; } while (0) | 1 | #define SWAP(x, y) do { x ^= y; y ^= x; x ^= y; } while (0) |
| 2 | #define _min(x, y) ((x) < (y) ? (x) : (y)) | 2 | #define MIN(x, y) ((x) < (y) ? (x) : (y)) |
| 3 | #define _max(x, y) ((x) > (y) ? (x) : (y)) | 3 | #define MAX(x, y) ((x) > (y) ? (x) : (y)) |
| 4 | #define _div_round_up(n, d) (((n) + (d) - 1) / (d)) | 4 | #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) |
| 5 | 5 | ||
| 6 | STATIC int64_t factorial(int64_t); | 6 | STATIC int64_t factorial(int64_t); |
| 7 | STATIC bool isperm(uint8_t *, int64_t); | 7 | STATIC bool isperm(uint8_t *, int64_t); |
