aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-09-03 21:52:16 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-09-03 21:52:16 +0200
commitc9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8 (patch)
treef4f569fcbd4d6704fb5dd44892911ce808f03332
parentff4bde84872ec0b93f0f097f5a56bd5e7cbb0311 (diff)
downloadnissy-core-c9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8.tar.gz
nissy-core-c9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8.zip
Moved stuff around
Diffstat (limited to '')
-rwxr-xr-xconfigure.sh9
-rw-r--r--src/core/cube.h66
-rw-r--r--src/core/moves.h88
-rw-r--r--src/core/transform.h18
-rw-r--r--src/core/transform_with_switch.h18
-rw-r--r--src/solvers/h48/solve.h46
-rw-r--r--src/utils/constants.h7
-rw-r--r--test/130_allowednext_h48/00_empty_U.in (renamed from test/082_allowednext_h48/00_empty_U.in)0
-rw-r--r--test/130_allowednext_h48/00_empty_U.out (renamed from test/082_allowednext_h48/00_empty_U.out)0
-rw-r--r--test/130_allowednext_h48/01_F.in (renamed from test/082_allowednext_h48/01_F.in)0
-rw-r--r--test/130_allowednext_h48/01_F.out (renamed from test/082_allowednext_h48/01_F.out)0
-rw-r--r--test/130_allowednext_h48/02_U2.in (renamed from test/082_allowednext_h48/02_U2.in)0
-rw-r--r--test/130_allowednext_h48/02_U2.out (renamed from test/082_allowednext_h48/02_U2.out)0
-rw-r--r--test/130_allowednext_h48/03_R_L.in (renamed from test/082_allowednext_h48/03_R_L.in)0
-rw-r--r--test/130_allowednext_h48/03_R_L.out (renamed from test/082_allowednext_h48/03_R_L.out)0
-rw-r--r--test/130_allowednext_h48/04_D.in (renamed from test/082_allowednext_h48/04_D.in)0
-rw-r--r--test/130_allowednext_h48/04_D.out (renamed from test/082_allowednext_h48/04_D.out)0
-rw-r--r--test/130_allowednext_h48/05_U_F_B2.in (renamed from test/082_allowednext_h48/05_U_F_B2.in)0
-rw-r--r--test/130_allowednext_h48/05_U_F_B2.out (renamed from test/082_allowednext_h48/05_U_F_B2.out)0
-rw-r--r--test/130_allowednext_h48/06_empty_bound.in (renamed from test/082_allowednext_h48/06_empty_bound.in)0
-rw-r--r--test/130_allowednext_h48/06_empty_bound.out (renamed from test/082_allowednext_h48/06_empty_bound.out)0
-rw-r--r--test/130_allowednext_h48/07_F_bound.in (renamed from test/082_allowednext_h48/07_F_bound.in)0
-rw-r--r--test/130_allowednext_h48/07_F_bound.out (renamed from test/082_allowednext_h48/07_F_bound.out)0
-rw-r--r--test/130_allowednext_h48/08_U_D_bound_inverse.in (renamed from test/082_allowednext_h48/08_U_D_bound_inverse.in)0
-rw-r--r--test/130_allowednext_h48/08_U_D_bound_inverse.out (renamed from test/082_allowednext_h48/08_U_D_bound_inverse.out)0
-rw-r--r--test/130_allowednext_h48/09_R_false_bound.in (renamed from test/082_allowednext_h48/09_R_false_bound.in)0
-rw-r--r--test/130_allowednext_h48/09_R_false_bound.out (renamed from test/082_allowednext_h48/09_R_false_bound.out)0
-rw-r--r--test/130_allowednext_h48/allowednext_h48_tests.c (renamed from test/082_allowednext_h48/allowednext_h48_tests.c)4
28 files changed, 132 insertions, 124 deletions
diff --git a/configure.sh b/configure.sh
index 76d02de..e12dc06 100755
--- a/configure.sh
+++ b/configure.sh
@@ -16,15 +16,18 @@ detectsan() {
16TYPE=${TYPE-"$detected"} 16TYPE=${TYPE-"$detected"}
17 17
18STD="-std=c99" 18STD="-std=c99"
19WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" 19WFLAGS="-pedantic -Wall -Wextra"
20# -Wstringop-overflow seems to be causing problems when combined with -O3
21# Someone else complained here: https://access.redhat.com/solutions/6755371
22WNOFLAGS="-Wno-unused-parameter -Wno-unused-function -Wno-stringop-overflow"
20[ "$TYPE" = "AVX2" ] && AVX="-mavx2" 23[ "$TYPE" = "AVX2" ] && AVX="-mavx2"
21[ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" 24[ -n "$(detectsan address)" ] && ADDR="-fsanitize=address"
22[ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" 25[ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined"
23SAN="$ADDR $UNDEF" 26SAN="$ADDR $UNDEF"
24LIBS="-lpthread" 27LIBS="-lpthread"
25 28
26CFLAGS="$STD $LIBS $WFLAGS $AVX -O3" 29CFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $AVX -O3"
27DBGFLAGS="$STD $LIBS $WFLAGS $SAN $AVX -g3 -DDEBUG" 30DBGFLAGS="$STD $LIBS $WFLAGS $WNOFLAGS $SAN $AVX -g3 -DDEBUG"
28 31
29echo "Cube type: CUBE_$TYPE" 32echo "Cube type: CUBE_$TYPE"
30echo "Compiler: ${CC:-cc}" 33echo "Compiler: ${CC:-cc}"
diff --git a/src/core/cube.h b/src/core/cube.h
index 4b28103..df5161a 100644
--- a/src/core/cube.h
+++ b/src/core/cube.h
@@ -1,25 +1,12 @@
1#define _move(M, c) compose(c, _move_cube_ ## M)
2#define _premove(M, c) compose(_move_cube_ ## M, c)
3
4_static cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]); 1_static cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]);
5_static cube_t solvedcube(void); 2_static cube_t solvedcube(void);
6_static bool isconsistent(cube_t); 3_static bool isconsistent(cube_t);
7_static bool issolvable(cube_t); 4_static bool issolvable(cube_t);
8_static bool issolved(cube_t); 5_static bool issolved(cube_t);
9_static bool iserror(cube_t); 6_static bool iserror(cube_t);
10_static cube_t applymoves(cube_t, const char *);
11_static cube_t applytrans(cube_t, const char *);
12_static cube_t frommoves(const char *);
13_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 *);
14_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);
15 9
16_static cube_t transform_edges(cube_t, uint8_t);
17_static cube_t transform_corners(cube_t, uint8_t);
18_static cube_t transform(cube_t, uint8_t);
19
20/* declared in moves.h */
21_static cube_t move(cube_t, uint8_t);
22
23_static cube_t 10_static cube_t
24cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) 11cubefromarray(uint8_t c[static 8], uint8_t e[static 12])
25{ 12{
@@ -149,41 +136,6 @@ iserror(cube_t cube)
149 return equal(cube, zero); 136 return equal(cube, zero);
150} 137}
151 138
152_static cube_t
153applymoves(cube_t cube, const char *buf)
154{
155 uint8_t r, m;
156 const char *b;
157
158 DBG_ASSERT(isconsistent(cube), zero,
159 "move error: inconsistent cube\n");
160
161 for (b = buf; *b != '\0'; b++) {
162 while (*b == ' ' || *b == '\t' || *b == '\n')
163 b++;
164 if (*b == '\0')
165 goto applymoves_finish;
166 if ((r = readmove(*b)) == _error)
167 goto applymoves_error;
168 if ((m = readmodifier(*(b+1))) != 0)
169 b++;
170 cube = move(cube, r + m);
171 }
172
173applymoves_finish:
174 return cube;
175
176applymoves_error:
177 LOG("applymoves error\n");
178 return zero;
179}
180
181_static cube_t
182frommoves(const char *buf)
183{
184 return applymoves(solved, buf);
185}
186
187_static void 139_static void
188getcube_fix(int64_t *ep, int64_t *eo, int64_t *cp, int64_t *co) 140getcube_fix(int64_t *ep, int64_t *eo, int64_t *cp, int64_t *co)
189{ 141{
@@ -227,21 +179,3 @@ getcube(int64_t ep, int64_t eo, int64_t cp, int64_t co)
227 179
228 return cubefromarray(carr, earr); 180 return cubefromarray(carr, earr);
229} 181}
230
231_static cube_t
232applytrans(cube_t cube, const char *buf)
233{
234 uint8_t t;
235
236 DBG_ASSERT(isconsistent(cube), zero,
237 "transformation error: inconsistent cube\n");
238
239 t = readtrans(buf);
240
241 return transform(cube, t);
242}
243
244/*
245TODO transform is now relegated to a separated file because it is too long.
246It would be nice to make it shorter without loosing performance.
247*/
diff --git a/src/core/moves.h b/src/core/moves.h
index 8f9c8f5..71ef470 100644
--- a/src/core/moves.h
+++ b/src/core/moves.h
@@ -1,13 +1,7 @@
1/* probably these can be placed in constants file */ 1#define _move(M, c) compose(c, _move_cube_ ## M)
2#define NORMAL 0x00 2#define _premove(M, c) compose(_move_cube_ ## M, c)
3#define INVERSE 0x01
4#define INVERSEBRANCH 0x03
5#define NORMALBRANCH 0x02
6#define ALLMOVES 0x3FFFF
7#define NOHALFTURNS 0x2DB6D
8 3
9_static_inline bool allowednextmove(uint8_t *, uint8_t); 4_static_inline bool allowednextmove(uint8_t *, uint8_t);
10_static uint32_t allowednextmoveH48(uint8_t *, uint8_t, uint32_t);
11 5
12_static_inline uint8_t inverse_trans(uint8_t); 6_static_inline uint8_t inverse_trans(uint8_t);
13_static_inline uint8_t movebase(uint8_t); 7_static_inline uint8_t movebase(uint8_t);
@@ -17,7 +11,10 @@ _static_inline uint32_t disable_moves(uint32_t, uint8_t);
17_static cube_t move(cube_t, uint8_t); 11_static cube_t move(cube_t, uint8_t);
18_static cube_t premove(cube_t, uint8_t); 12_static cube_t premove(cube_t, uint8_t);
19_static uint8_t inverse_move(uint8_t); 13_static uint8_t inverse_move(uint8_t);
20_static uint8_t* invertpremoves(uint8_t *, uint8_t); 14_static void invertmoves(uint8_t *, uint8_t, uint8_t *);
15
16_static cube_t applymoves(cube_t, const char *);
17_static cube_t frommoves(const char *);
21 18
22_static bool 19_static bool
23allowednextmove(uint8_t *moves, uint8_t n) 20allowednextmove(uint8_t *moves, uint8_t n)
@@ -50,34 +47,6 @@ disable_moves(uint32_t current_result, uint8_t base_index)
50 return current_result & ~(7 << base_index); 47 return current_result & ~(7 << base_index);
51} 48}
52 49
53_static uint32_t
54allowednextmoveH48(uint8_t *moves, uint8_t n, uint32_t h48branch)
55{
56 uint32_t result = ALLMOVES;
57 if (h48branch & NORMALBRANCH)
58 result &= NOHALFTURNS;
59 if (n < 1)
60 return result;
61
62 uint8_t base1 = movebase(moves[n-1]);
63 uint8_t axis1 = moveaxis(moves[n-1]);
64
65 result = disable_moves(result, base1 * 3);
66 if (base1 % 2)
67 result = disable_moves(result, (base1 - 1) * 3);
68
69 if (n == 1)
70 return result;
71
72 uint8_t base2 = movebase(moves[n-2]);
73 uint8_t axis2 = moveaxis(moves[n-2]);
74
75 if(axis1 == axis2)
76 result = disable_moves(result, base2 * 3);
77
78 return result;
79}
80
81_static_inline uint8_t 50_static_inline uint8_t
82inverse_trans(uint8_t t) 51inverse_trans(uint8_t t)
83{ 52{
@@ -194,17 +163,46 @@ inverse_move(uint8_t m)
194 return m - 2 * (m % 3) + 2; 163 return m - 2 * (m % 3) + 2;
195} 164}
196 165
197_static uint8_t* 166_static void
198invertpremoves(uint8_t *moves, uint8_t nmoves) 167invertmoves(uint8_t *moves, uint8_t nmoves, uint8_t *ret)
199{ 168{
200 uint8_t i; 169 uint8_t i;
201 uint8_t *ret = malloc(nmoves * sizeof(uint8_t));
202 170
203 for (i = 0; i < nmoves; i++) 171 for (i = 0; i < nmoves; i++)
204 ret[i] = inverse_move(moves[i]); 172 ret[i] = inverse_move(moves[nmoves - i - 1]);
173}
205 174
206 // invert elements in the array 175_static cube_t
207 for (i = 0; i < nmoves / 2; i++) 176applymoves(cube_t cube, const char *buf)
208 _swap(ret[i], ret[nmoves - i - 1]); 177{
209 return ret; 178 uint8_t r, m;
179 const char *b;
180
181 DBG_ASSERT(isconsistent(cube), zero,
182 "move error: inconsistent cube\n");
183
184 for (b = buf; *b != '\0'; b++) {
185 while (*b == ' ' || *b == '\t' || *b == '\n')
186 b++;
187 if (*b == '\0')
188 goto applymoves_finish;
189 if ((r = readmove(*b)) == _error)
190 goto applymoves_error;
191 if ((m = readmodifier(*(b+1))) != 0)
192 b++;
193 cube = move(cube, r + m);
194 }
195
196applymoves_finish:
197 return cube;
198
199applymoves_error:
200 LOG("applymoves error\n");
201 return zero;
202}
203
204_static cube_t
205frommoves(const char *buf)
206{
207 return applymoves(solved, buf);
210} 208}
diff --git a/src/core/transform.h b/src/core/transform.h
index 358b051..fa7ce59 100644
--- a/src/core/transform.h
+++ b/src/core/transform.h
@@ -19,6 +19,11 @@
19 invertco(compose(compose(_trans_cube_ ## T, c), \ 19 invertco(compose(compose(_trans_cube_ ## T, c), \
20 _trans_cube_ ## T ## _inverse)) 20 _trans_cube_ ## T ## _inverse))
21 21
22_static cube_t transform_edges(cube_t, uint8_t);
23_static cube_t transform_corners(cube_t, uint8_t);
24_static cube_t transform(cube_t, uint8_t);
25_static cube_t applytrans(cube_t, const char *);
26
22static cube_t cube_trans_table[48] = { 27static cube_t cube_trans_table[48] = {
23 [_trans_UFr] = _trans_cube_UFr, 28 [_trans_UFr] = _trans_cube_UFr,
24 [_trans_UFm] = _trans_cube_UFm, 29 [_trans_UFm] = _trans_cube_UFm,
@@ -174,3 +179,16 @@ transform(cube_t c, uint8_t t)
174 179
175 return t < 24 ? ret : invertco(ret); 180 return t < 24 ? ret : invertco(ret);
176} 181}
182
183_static cube_t
184applytrans(cube_t cube, const char *buf)
185{
186 uint8_t t;
187
188 DBG_ASSERT(isconsistent(cube), zero,
189 "transformation error: inconsistent cube\n");
190
191 t = readtrans(buf);
192
193 return transform(cube, t);
194}
diff --git a/src/core/transform_with_switch.h b/src/core/transform_with_switch.h
index d3a108c..429e656 100644
--- a/src/core/transform_with_switch.h
+++ b/src/core/transform_with_switch.h
@@ -17,6 +17,11 @@
17 invertco(compose(compose(_trans_cube_ ## T, c), \ 17 invertco(compose(compose(_trans_cube_ ## T, c), \
18 _trans_cube_ ## T ## _inverse)) 18 _trans_cube_ ## T ## _inverse))
19 19
20_static cube_t transform_edges(cube_t, uint8_t);
21_static cube_t transform_corners(cube_t, uint8_t);
22_static cube_t transform(cube_t, uint8_t);
23_static cube_t applytrans(cube_t, const char *);
24
20_static cube_t 25_static cube_t
21transform_edges(cube_t c, uint8_t t) 26transform_edges(cube_t c, uint8_t t)
22{ 27{
@@ -334,3 +339,16 @@ transform(cube_t c, uint8_t t)
334 return zero; 339 return zero;
335 } 340 }
336} 341}
342
343_static cube_t
344applytrans(cube_t cube, const char *buf)
345{
346 uint8_t t;
347
348 DBG_ASSERT(isconsistent(cube), zero,
349 "transformation error: inconsistent cube\n");
350
351 t = readtrans(buf);
352
353 return transform(cube, t);
354}
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index bbe59e5..3878498 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -26,6 +26,8 @@ typedef struct {
26 char *s; 26 char *s;
27} dfsarg_solveh48stats_t; 27} dfsarg_solveh48stats_t;
28 28
29_static uint32_t allowednextmove_h48(uint8_t *, uint8_t, uint32_t);
30
29_static void solve_h48_appendsolution(dfsarg_solveh48_t *); 31_static void solve_h48_appendsolution(dfsarg_solveh48_t *);
30_static_inline bool solve_h48_stop(dfsarg_solveh48_t *); 32_static_inline bool solve_h48_stop(dfsarg_solveh48_t *);
31_static int64_t solve_h48_dfs(dfsarg_solveh48_t *); 33_static int64_t solve_h48_dfs(dfsarg_solveh48_t *);
@@ -34,10 +36,39 @@ _static int64_t solve_h48(cube_t, int8_t, int8_t, int8_t, uint8_t, uint8_t, cons
34_static int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *); 36_static int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *);
35_static int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]); 37_static int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]);
36 38
39_static uint32_t
40allowednextmove_h48(uint8_t *moves, uint8_t n, uint32_t h48branch)
41{
42 uint32_t result = _mm_allmoves;
43 if (h48branch & _mm_normalbranch)
44 result &= _mm_nohalfturns;
45 if (n < 1)
46 return result;
47
48 uint8_t base1 = movebase(moves[n-1]);
49 uint8_t axis1 = moveaxis(moves[n-1]);
50
51 result = disable_moves(result, base1 * 3);
52 if (base1 % 2)
53 result = disable_moves(result, (base1 - 1) * 3);
54
55 if (n == 1)
56 return result;
57
58 uint8_t base2 = movebase(moves[n-2]);
59 uint8_t axis2 = moveaxis(moves[n-2]);
60
61 if(axis1 == axis2)
62 result = disable_moves(result, base2 * 3);
63
64 return result;
65}
66
37_static void 67_static void
38solve_h48_appendsolution(dfsarg_solveh48_t *arg) 68solve_h48_appendsolution(dfsarg_solveh48_t *arg)
39{ 69{
40 int strl; 70 int strl;
71 uint8_t invertedpremoves[MAXLEN];
41 char *solution = *arg->nextsol; 72 char *solution = *arg->nextsol;
42 73
43 strl = writemoves(arg->moves, arg->nmoves, *arg->nextsol); 74 strl = writemoves(arg->moves, arg->nmoves, *arg->nextsol);
@@ -47,9 +78,8 @@ solve_h48_appendsolution(dfsarg_solveh48_t *arg)
47 **arg->nextsol = ' '; 78 **arg->nextsol = ' ';
48 (*arg->nextsol)++; 79 (*arg->nextsol)++;
49 80
50 uint8_t* invertedpremoves = invertpremoves(arg->premoves, arg->npremoves); 81 invertmoves(arg->premoves, arg->npremoves, invertedpremoves);
51 strl = writemoves(invertedpremoves, arg->npremoves, *arg->nextsol); 82 strl = writemoves(invertedpremoves, arg->npremoves, *arg->nextsol);
52 free(invertedpremoves);
53 *arg->nextsol += strl; 83 *arg->nextsol += strl;
54 } 84 }
55 LOG("Solution found: %s\n", solution); 85 LOG("Solution found: %s\n", solution);
@@ -65,7 +95,7 @@ solve_h48_stop(dfsarg_solveh48_t *arg)
65 uint32_t data, data_inv; 95 uint32_t data, data_inv;
66 int8_t bound; 96 int8_t bound;
67 97
68 arg->nissbranch = NORMAL; 98 arg->nissbranch = _mm_normal;
69 bound = get_h48_cdata(arg->cube, arg->cocsepdata, &data); 99 bound = get_h48_cdata(arg->cube, arg->cocsepdata, &data);
70 if (bound + arg->nmoves + arg->npremoves > arg->depth) 100 if (bound + arg->nmoves + arg->npremoves > arg->depth)
71 return true; 101 return true;
@@ -79,13 +109,13 @@ solve_h48_stop(dfsarg_solveh48_t *arg)
79 if (bound + arg->nmoves + arg->npremoves > arg->depth) 109 if (bound + arg->nmoves + arg->npremoves > arg->depth)
80 return true; 110 return true;
81 if (bound + arg->nmoves + arg->npremoves == arg->depth) 111 if (bound + arg->nmoves + arg->npremoves == arg->depth)
82 arg->nissbranch = INVERSEBRANCH; 112 arg->nissbranch = _mm_inversebranch;
83 113
84 bound = get_h48_bound(arg->inverse, data_inv, arg->h, arg->k, arg->h48data); 114 bound = get_h48_bound(arg->inverse, data_inv, arg->h, arg->k, arg->h48data);
85 if (bound + arg->nmoves + arg->npremoves > arg->depth) 115 if (bound + arg->nmoves + arg->npremoves > arg->depth)
86 return true; 116 return true;
87 if (bound + arg->nmoves + arg->npremoves == arg->depth) 117 if (bound + arg->nmoves + arg->npremoves == arg->depth)
88 arg->nissbranch = NORMALBRANCH; 118 arg->nissbranch = _mm_normalbranch;
89 119
90 return false; 120 return false;
91} 121}
@@ -114,8 +144,8 @@ solve_h48_dfs(dfsarg_solveh48_t *arg)
114 nextarg = *arg; 144 nextarg = *arg;
115 ret = 0; 145 ret = 0;
116 uint32_t allowed; 146 uint32_t allowed;
117 if(arg->nissbranch & INVERSE) { 147 if(arg->nissbranch & _mm_inverse) {
118 allowed = allowednextmoveH48(arg->premoves, arg->npremoves, arg->nissbranch); 148 allowed = allowednextmove_h48(arg->premoves, arg->npremoves, arg->nissbranch);
119 for (m = 0; m < 18; m++) { 149 for (m = 0; m < 18; m++) {
120 if(allowed & (1 << m)) { 150 if(allowed & (1 << m)) {
121 nextarg.npremoves = arg->npremoves + 1; 151 nextarg.npremoves = arg->npremoves + 1;
@@ -126,7 +156,7 @@ solve_h48_dfs(dfsarg_solveh48_t *arg)
126 } 156 }
127 } 157 }
128 } else { 158 } else {
129 allowed = allowednextmoveH48(arg->moves, arg->nmoves, arg->nissbranch); 159 allowed = allowednextmove_h48(arg->moves, arg->nmoves, arg->nissbranch);
130 for (m = 0; m < 18; m++) { 160 for (m = 0; m < 18; m++) {
131 if (allowed & (1 << m)) { 161 if (allowed & (1 << m)) {
132 nextarg.nmoves = arg->nmoves + 1; 162 nextarg.nmoves = arg->nmoves + 1;
diff --git a/src/utils/constants.h b/src/utils/constants.h
index 52e2810..34b4f00 100644
--- a/src/utils/constants.h
+++ b/src/utils/constants.h
@@ -97,6 +97,13 @@ _static int64_t binomial[12][12] = {
97#define _trans_BDm UINT8_C(46) 97#define _trans_BDm UINT8_C(46)
98#define _trans_BLm UINT8_C(47) 98#define _trans_BLm UINT8_C(47)
99 99
100#define _mm_normal UINT32_C(0x00)
101#define _mm_inverse UINT32_C(0x01)
102#define _mm_inversebranch UINT32_C(0x03)
103#define _mm_normalbranch UINT32_C(0x02)
104#define _mm_allmoves UINT32_C(0x3FFFF)
105#define _mm_nohalfturns UINT32_C(0x2DB6D)
106
100#define _c_ufr UINT8_C(0) 107#define _c_ufr UINT8_C(0)
101#define _c_ubl UINT8_C(1) 108#define _c_ubl UINT8_C(1)
102#define _c_dfl UINT8_C(2) 109#define _c_dfl UINT8_C(2)
diff --git a/test/082_allowednext_h48/00_empty_U.in b/test/130_allowednext_h48/00_empty_U.in
index 28271a6..28271a6 100644
--- a/test/082_allowednext_h48/00_empty_U.in
+++ b/test/130_allowednext_h48/00_empty_U.in
diff --git a/test/082_allowednext_h48/00_empty_U.out b/test/130_allowednext_h48/00_empty_U.out
index 8607955..8607955 100644
--- a/test/082_allowednext_h48/00_empty_U.out
+++ b/test/130_allowednext_h48/00_empty_U.out
diff --git a/test/082_allowednext_h48/01_F.in b/test/130_allowednext_h48/01_F.in
index e7ae375..e7ae375 100644
--- a/test/082_allowednext_h48/01_F.in
+++ b/test/130_allowednext_h48/01_F.in
diff --git a/test/082_allowednext_h48/01_F.out b/test/130_allowednext_h48/01_F.out
index 5d6f843..5d6f843 100644
--- a/test/082_allowednext_h48/01_F.out
+++ b/test/130_allowednext_h48/01_F.out
diff --git a/test/082_allowednext_h48/02_U2.in b/test/130_allowednext_h48/02_U2.in
index 2c5ee5f..2c5ee5f 100644
--- a/test/082_allowednext_h48/02_U2.in
+++ b/test/130_allowednext_h48/02_U2.in
diff --git a/test/082_allowednext_h48/02_U2.out b/test/130_allowednext_h48/02_U2.out
index a9a5adb..a9a5adb 100644
--- a/test/082_allowednext_h48/02_U2.out
+++ b/test/130_allowednext_h48/02_U2.out
diff --git a/test/082_allowednext_h48/03_R_L.in b/test/130_allowednext_h48/03_R_L.in
index b6c0625..b6c0625 100644
--- a/test/082_allowednext_h48/03_R_L.in
+++ b/test/130_allowednext_h48/03_R_L.in
diff --git a/test/082_allowednext_h48/03_R_L.out b/test/130_allowednext_h48/03_R_L.out
index a4aa4b2..a4aa4b2 100644
--- a/test/082_allowednext_h48/03_R_L.out
+++ b/test/130_allowednext_h48/03_R_L.out
diff --git a/test/082_allowednext_h48/04_D.in b/test/130_allowednext_h48/04_D.in
index 83da556..83da556 100644
--- a/test/082_allowednext_h48/04_D.in
+++ b/test/130_allowednext_h48/04_D.in
diff --git a/test/082_allowednext_h48/04_D.out b/test/130_allowednext_h48/04_D.out
index fe91843..fe91843 100644
--- a/test/082_allowednext_h48/04_D.out
+++ b/test/130_allowednext_h48/04_D.out
diff --git a/test/082_allowednext_h48/05_U_F_B2.in b/test/130_allowednext_h48/05_U_F_B2.in
index 67e090f..67e090f 100644
--- a/test/082_allowednext_h48/05_U_F_B2.in
+++ b/test/130_allowednext_h48/05_U_F_B2.in
diff --git a/test/082_allowednext_h48/05_U_F_B2.out b/test/130_allowednext_h48/05_U_F_B2.out
index 5d6f843..5d6f843 100644
--- a/test/082_allowednext_h48/05_U_F_B2.out
+++ b/test/130_allowednext_h48/05_U_F_B2.out
diff --git a/test/082_allowednext_h48/06_empty_bound.in b/test/130_allowednext_h48/06_empty_bound.in
index 389e262..389e262 100644
--- a/test/082_allowednext_h48/06_empty_bound.in
+++ b/test/130_allowednext_h48/06_empty_bound.in
diff --git a/test/082_allowednext_h48/06_empty_bound.out b/test/130_allowednext_h48/06_empty_bound.out
index eb601fc..eb601fc 100644
--- a/test/082_allowednext_h48/06_empty_bound.out
+++ b/test/130_allowednext_h48/06_empty_bound.out
diff --git a/test/082_allowednext_h48/07_F_bound.in b/test/130_allowednext_h48/07_F_bound.in
index b3ae33d..b3ae33d 100644
--- a/test/082_allowednext_h48/07_F_bound.in
+++ b/test/130_allowednext_h48/07_F_bound.in
diff --git a/test/082_allowednext_h48/07_F_bound.out b/test/130_allowednext_h48/07_F_bound.out
index 0dc8997..0dc8997 100644
--- a/test/082_allowednext_h48/07_F_bound.out
+++ b/test/130_allowednext_h48/07_F_bound.out
diff --git a/test/082_allowednext_h48/08_U_D_bound_inverse.in b/test/130_allowednext_h48/08_U_D_bound_inverse.in
index 707f7e0..707f7e0 100644
--- a/test/082_allowednext_h48/08_U_D_bound_inverse.in
+++ b/test/130_allowednext_h48/08_U_D_bound_inverse.in
diff --git a/test/082_allowednext_h48/08_U_D_bound_inverse.out b/test/130_allowednext_h48/08_U_D_bound_inverse.out
index 6f47cf0..6f47cf0 100644
--- a/test/082_allowednext_h48/08_U_D_bound_inverse.out
+++ b/test/130_allowednext_h48/08_U_D_bound_inverse.out
diff --git a/test/082_allowednext_h48/09_R_false_bound.in b/test/130_allowednext_h48/09_R_false_bound.in
index 0b1d441..0b1d441 100644
--- a/test/082_allowednext_h48/09_R_false_bound.in
+++ b/test/130_allowednext_h48/09_R_false_bound.in
diff --git a/test/082_allowednext_h48/09_R_false_bound.out b/test/130_allowednext_h48/09_R_false_bound.out
index 121bfeb..121bfeb 100644
--- a/test/082_allowednext_h48/09_R_false_bound.out
+++ b/test/130_allowednext_h48/09_R_false_bound.out
diff --git a/test/082_allowednext_h48/allowednext_h48_tests.c b/test/130_allowednext_h48/allowednext_h48_tests.c
index 4cee695..64ded35 100644
--- a/test/082_allowednext_h48/allowednext_h48_tests.c
+++ b/test/130_allowednext_h48/allowednext_h48_tests.c
@@ -1,6 +1,6 @@
1#include "../test.h" 1#include "../test.h"
2 2
3uint32_t allowednextmoveH48(uint8_t *, uint8_t, uint32_t); 3uint32_t allowednextmove_h48(uint8_t *, uint8_t, uint32_t);
4 4
5static char *moves[] = { 5static char *moves[] = {
6 "U", "U2", "U'", 6 "U", "U2", "U'",
@@ -33,6 +33,6 @@ void run(void) {
33 fprintf(stderr, "Last two: %s, %s\n", 33 fprintf(stderr, "Last two: %s, %s\n",
34 n > 1 ? moves[m[n-2]] : "-", 34 n > 1 ? moves[m[n-2]] : "-",
35 n > 0 ? moves[m[n-1]] : "-"); 35 n > 0 ? moves[m[n-1]] : "-");
36 uint32_t allowed = allowednextmoveH48(m, n, bound); 36 uint32_t allowed = allowednextmove_h48(m, n, bound);
37 printf("0x%05X\n", allowed); 37 printf("0x%05X\n", allowed);
38} 38}

Generated with cgit - Back to sebastiano.tronto.net