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