aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-01-12 18:09:43 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-01-12 18:09:43 +0100
commit9a013b7c68f94e6be0fe8748c9012a441fe0273f (patch)
treed6bb6de992eace566d033d0824c03da89cf7b9cb /src/utils
parent83f6533c384a617181e818d1941b08e40aa40b7d (diff)
downloadnissy-core-9a013b7c68f94e6be0fe8748c9012a441fe0273f.tar.gz
nissy-core-9a013b7c68f94e6be0fe8748c9012a441fe0273f.zip
Improve performance of H48 solver with prefetching
With this commit we re-structure how the node expansion in the H48 solution search works to allow prefetching of pruning values, showing performance improvements in the range of 30-45% on x86, depending on table size and solution length. A small bug fix related to appending solutions is included in this commit.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/prefetch.h15
-rw-r--r--src/utils/utils.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/utils/prefetch.h b/src/utils/prefetch.h
new file mode 100644
index 0000000..89b14e8
--- /dev/null
+++ b/src/utils/prefetch.h
@@ -0,0 +1,15 @@
1#if defined(AVX2)
2
3#define prefetch(a, i) _mm_prefetch(a+i, _MM_HINT_T0)
4
5#else
6#if defined(__GNUC__) || defined(__clang__)
7
8#define prefetch(a, i) __builtin_prefetch(a+i, 0, 0)
9
10#else
11
12#define prefetch(a, i) (void)i
13
14#endif
15#endif
diff --git a/src/utils/utils.h b/src/utils/utils.h
index 383781a..e322f20 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -4,3 +4,4 @@
4#include "math.h" 4#include "math.h"
5#include "sleep.h" 5#include "sleep.h"
6#include "wrapthread.h" 6#include "wrapthread.h"
7#include "prefetch.h"

Generated with cgit - Back to sebastiano.tronto.net