aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--build.bat20
-rw-r--r--src/utils/prefetch.h16
3 files changed, 22 insertions, 20 deletions
diff --git a/README.md b/README.md
index 338a280..64871b5 100644
--- a/README.md
+++ b/README.md
@@ -64,9 +64,9 @@ can be used to build the basic shell, while
64Builds and runs the unit tests. See `build.bat help` for a list of 64Builds and runs the unit tests. See `build.bat help` for a list of
65all available options. 65all available options.
66 66
67Note: At the moment certain optimizations, such as multithreading and 67Note: The build script for Windows does not support all the options
68advanced CPU instructions, are not supported on Windows. 68available with build.sh. If you want to tune the build options, you'll
69Work is ongoing to improve Windows support. 69have to manually edit the build script.
70 70
71## Running tests 71## Running tests
72 72
diff --git a/build.bat b/build.bat
index 91cc4db..b082e03 100644
--- a/build.bat
+++ b/build.bat
@@ -9,15 +9,25 @@ if [%1]==[/d] (
9 9
10SET CC=clang 10SET CC=clang
11SET CXX=clang++ 11SET CXX=clang++
12SET ARCH=PORTABLE
13SET THREADS=16 12SET THREADS=16
14SET SANITIZE= 13SET SANITIZE=
15 14
16:: TODO depends on ARCH variable 15SET ARCH=PORTABLE
17SET ARCHOPTS= 16clang -march=native -dM -E - < NUL | findstr /C:"__AVX2__" >NUL 2>&1
18:: TODO depends on SANITIZE variable 17if %ERRORLEVEL% EQU 0 (
19SET DFLAGS=-g3 -DDEBUG 18 SET ARCH=AVX2
19 SET ARCHOPTS=-mavx2
20 goto :ArchDone
21)
22clang -march=native -dM -E - < NUL | findstr /C:"__ARM_NEON" >NUL 2>&1
23if %ERRORLEVEL% EQU 0 (
24 SET ARCH=NEON
25 goto :ArchDone
26)
27:ArchDone
28
20 29
30SET DFLAGS=-g3 -DDEBUG
21SET WARNINGS=-Wno-deprecated-declarations 31SET WARNINGS=-Wno-deprecated-declarations
22SET VARIABLES=-DTHREADS=%THREADS% -D%ARCH% 32SET VARIABLES=-DTHREADS=%THREADS% -D%ARCH%
23SET OFLAGS=-O3 33SET OFLAGS=-O3
diff --git a/src/utils/prefetch.h b/src/utils/prefetch.h
index 89b14e8..a2c41ef 100644
--- a/src/utils/prefetch.h
+++ b/src/utils/prefetch.h
@@ -1,15 +1,7 @@
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__) 1#if defined(__GNUC__) || defined(__clang__)
7 2 #define prefetch(a, i) __builtin_prefetch(a+i, 0, 0)
8#define prefetch(a, i) __builtin_prefetch(a+i, 0, 0) 3#elif defined(AVX2)
9 4 #define prefetch(a, i) _mm_prefetch((char *)(a+i), _MM_HINT_T0)
10#else 5#else
11 6 #define prefetch(a, i) (void)i
12#define prefetch(a, i) (void)i
13
14#endif
15#endif 7#endif

Generated with cgit - Back to sebastiano.tronto.net