diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-16 11:46:33 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-16 11:46:38 +0200 |
| commit | f9570e5089eeabe32be84ab0507c1d9df99650af (patch) | |
| tree | a7e89e26b84d833fcc29fecc19d5e6f6c61af3e6 | |
| parent | 7c994d0ee99d8b69bf958f1559db3a294f459e3e (diff) | |
| download | nissy-core-f9570e5089eeabe32be84ab0507c1d9df99650af.tar.gz nissy-core-f9570e5089eeabe32be84ab0507c1d9df99650af.zip | |
Removed redundant coordinate computation
Diffstat (limited to '')
| -rw-r--r-- | .gitignore | 1 | ||||
| -rwxr-xr-x | debugrun | bin | 1865168 -> 0 bytes | |||
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 16 | ||||
| -rw-r--r-- | src/solvers/h48/solve.h | 16 | ||||
| -rw-r--r-- | src/solvers/h48/stats.h | 2 |
5 files changed, 12 insertions, 23 deletions
| @@ -8,6 +8,7 @@ utils/.DS_Store | |||
| 8 | perf.data | 8 | perf.data |
| 9 | perf.data.old | 9 | perf.data.old |
| 10 | run | 10 | run |
| 11 | debugrun | ||
| 11 | shell/lasttest.out | 12 | shell/lasttest.out |
| 12 | shell/lasttest.err | 13 | shell/lasttest.err |
| 13 | tables/* | 14 | tables/* |
diff --git a/debugrun b/debugrun deleted file mode 100755 index bc982a6..0000000 --- a/debugrun +++ /dev/null | |||
| Binary files differ | |||
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 4400011..55c4f34 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -24,8 +24,6 @@ STATIC_INLINE uint8_t get_h48_pval_atomic( | |||
| 24 | _Atomic const uint8_t *, int64_t, uint8_t); | 24 | _Atomic const uint8_t *, int64_t, uint8_t); |
| 25 | STATIC_INLINE void set_h48_pval_atomic( | 25 | STATIC_INLINE void set_h48_pval_atomic( |
| 26 | _Atomic uint8_t *, int64_t, uint8_t, uint8_t); | 26 | _Atomic uint8_t *, int64_t, uint8_t, uint8_t); |
| 27 | STATIC_INLINE uint8_t get_h48_bound( | ||
| 28 | cube_t, uint32_t, uint8_t, uint8_t, const uint8_t *); | ||
| 29 | 27 | ||
| 30 | size_t gendata_h48_derive(uint8_t, const void *, void *); | 28 | size_t gendata_h48_derive(uint8_t, const void *, void *); |
| 31 | 29 | ||
| @@ -686,20 +684,6 @@ set_h48_pval_atomic(_Atomic uint8_t *table, int64_t i, uint8_t k, uint8_t val) | |||
| 686 | | (val << H48_SHIFT(i, k)); | 684 | | (val << H48_SHIFT(i, k)); |
| 687 | } | 685 | } |
| 688 | 686 | ||
| 689 | STATIC_INLINE uint8_t | ||
| 690 | get_h48_bound( | ||
| 691 | cube_t cube, | ||
| 692 | uint32_t cdata, | ||
| 693 | uint8_t h, | ||
| 694 | uint8_t k, | ||
| 695 | const uint8_t *table | ||
| 696 | ) { | ||
| 697 | int64_t coord; | ||
| 698 | |||
| 699 | coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), h); | ||
| 700 | return get_h48_pval(table, coord, k); | ||
| 701 | } | ||
| 702 | |||
| 703 | size_t | 687 | size_t |
| 704 | gendata_h48_derive(uint8_t h, const void *fulltable, void *buf) | 688 | gendata_h48_derive(uint8_t h, const void *fulltable, void *buf) |
| 705 | { | 689 | { |
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 0723fb6..778155c 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -101,6 +101,7 @@ solve_h48_stop(dfsarg_solveh48_t *arg) | |||
| 101 | { | 101 | { |
| 102 | uint32_t data, data_inv; | 102 | uint32_t data, data_inv; |
| 103 | int8_t cbound, cbound_inv, h48bound, h48bound_inv; | 103 | int8_t cbound, cbound_inv, h48bound, h48bound_inv; |
| 104 | int64_t coord, coord_inv; | ||
| 104 | 105 | ||
| 105 | arg->nissbranch = MM_NORMAL; | 106 | arg->nissbranch = MM_NORMAL; |
| 106 | cbound = get_h48_cdata(arg->cube, arg->cocsepdata, &data); | 107 | cbound = get_h48_cdata(arg->cube, arg->cocsepdata, &data); |
| @@ -111,15 +112,16 @@ solve_h48_stop(dfsarg_solveh48_t *arg) | |||
| 111 | if (cbound_inv + arg->nmoves + arg->npremoves > arg->depth) | 112 | if (cbound_inv + arg->nmoves + arg->npremoves > arg->depth) |
| 112 | return true; | 113 | return true; |
| 113 | 114 | ||
| 114 | h48bound = get_h48_bound(arg->cube, data, arg->h, arg->k, arg->h48data); | 115 | coord = coord_h48_edges(arg->cube, COCLASS(data), TTREP(data), arg->h); |
| 116 | h48bound = get_h48_pval(arg->h48data, coord, arg->k); | ||
| 115 | 117 | ||
| 116 | /* If the h48 bound is > 0, we add the base value. */ | 118 | /* If the h48 bound is > 0, we add the base value. */ |
| 117 | /* Otherwise, we use the fallback h0k4 value instead. */ | 119 | /* Otherwise, we use the fallback h0k4 value instead. */ |
| 118 | 120 | ||
| 119 | if (arg->k == 2) { | 121 | if (arg->k == 2) { |
| 120 | if (h48bound == 0) { | 122 | if (h48bound == 0) { |
| 121 | h48bound = get_h48_bound( | 123 | h48bound = get_h48_pval( |
| 122 | arg->cube, data, 0, 4, arg->h48data_fallback); | 124 | arg->h48data_fallback, coord >> arg->h, 4); |
| 123 | } else { | 125 | } else { |
| 124 | h48bound += arg->base; | 126 | h48bound += arg->base; |
| 125 | } | 127 | } |
| @@ -129,11 +131,13 @@ solve_h48_stop(dfsarg_solveh48_t *arg) | |||
| 129 | if (h48bound + arg->nmoves + arg->npremoves == arg->depth) | 131 | if (h48bound + arg->nmoves + arg->npremoves == arg->depth) |
| 130 | arg->nissbranch = MM_INVERSEBRANCH; | 132 | arg->nissbranch = MM_INVERSEBRANCH; |
| 131 | 133 | ||
| 132 | h48bound_inv = get_h48_bound(arg->inverse, data_inv, arg->h, arg->k, arg->h48data); | 134 | coord_inv = coord_h48_edges( |
| 135 | arg->inverse, COCLASS(data_inv), TTREP(data_inv), arg->h); | ||
| 136 | h48bound_inv = get_h48_pval(arg->h48data, coord_inv, arg->k); | ||
| 133 | if (arg->k == 2) { | 137 | if (arg->k == 2) { |
| 134 | if (h48bound_inv == 0) { | 138 | if (h48bound_inv == 0) { |
| 135 | h48bound_inv = get_h48_bound( | 139 | h48bound_inv = get_h48_pval( |
| 136 | arg->inverse, data_inv, 0, 4, arg->h48data_fallback); | 140 | arg->h48data_fallback, coord_inv >> arg->h, 4); |
| 137 | } else { | 141 | } else { |
| 138 | h48bound_inv += arg->base; | 142 | h48bound_inv += arg->base; |
| 139 | } | 143 | } |
diff --git a/src/solvers/h48/stats.h b/src/solvers/h48/stats.h index cc51bd9..2a7e887 100644 --- a/src/solvers/h48/stats.h +++ b/src/solvers/h48/stats.h | |||
| @@ -36,7 +36,7 @@ solve_h48stats_dfs(dfsarg_solveh48stats_t *arg) | |||
| 36 | 36 | ||
| 37 | /* Check h48 lower bound for h=0 (esep, but no eo) */ | 37 | /* Check h48 lower bound for h=0 (esep, but no eo) */ |
| 38 | coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0); | 38 | coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0); |
| 39 | bound = get_h48_bound(arg->cube, d, 0, 4, arg->h48data); | 39 | bound = get_h48_pval(arg->h48data, coord, 4); |
| 40 | if (bound + arg->nmoves > arg->depth) | 40 | if (bound + arg->nmoves > arg->depth) |
| 41 | return 0; | 41 | return 0; |
| 42 | 42 | ||
