From a84e3ac287fa2c2db5ee58faabdb31943acc78d0 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 24 Jun 2020 23:03:00 +0200 Subject: [PATCH 1/4] Simplify use_time_management() and allow composing like other `go` commands wtime/btime can now be composed. `go depth 10 wtime 100` will let the engine use standard time management but stop if depth 10 is reached. fixes https://github.com/official-stockfish/Stockfish/issues/2767 closes https://github.com/official-stockfish/Stockfish/pull/2768 No functional change --- src/search.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.h b/src/search.h index 1653ce92..3e855c8b 100644 --- a/src/search.h +++ b/src/search.h @@ -91,7 +91,7 @@ struct LimitsType { } bool use_time_management() const { - return !(mate | movetime | depth | nodes | perft | infinite); + return time[WHITE] || time[BLACK]; } std::vector searchmoves; From aecfca2dc2d760df257e18cd6b29d266a3c3e68a Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Thu, 25 Jun 2020 12:42:25 +0200 Subject: [PATCH 2/4] support popcnt on armv8 * Supports popcnt (thanks @daylen) * bits = 64 is now the default Tested with g++ (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 on ThunderX CN8890, yields about 9% speedup. Also tested with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final). closes https://github.com/official-stockfish/Stockfish/pull/2770 No functional change. --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 81731e66..492403d3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -134,8 +134,8 @@ endif ifeq ($(ARCH),armv8) arch = armv8-a - bits = 64 prefetch = yes + popcnt = yes endif ifeq ($(ARCH),ppc-32) @@ -322,7 +322,7 @@ endif ### 3.6 popcnt ifeq ($(popcnt),yes) - ifeq ($(arch),ppc64) + ifeq ($(arch),$(filter $(arch),ppc64 armv8-a)) CXXFLAGS += -DUSE_POPCNT else ifeq ($(comp),icc) CXXFLAGS += -msse3 -DUSE_POPCNT From ca41ee6632368676a2fb98fd2970ac9b183f0aa9 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Sat, 27 Jun 2020 08:23:46 +0200 Subject: [PATCH 3/4] Revert LTO for mingw on windows. LTO with static linking is still only working with the latest versions of gcc, causing problems for some devs. on a modern mingw toolchain LTO optimizations can still be enabled as: ``` CXXFLAGS='-flto' make -j ARCH=x86-64-modern COMP=mingw profile-build ``` fixes https://github.com/official-stockfish/Stockfish/issues/2769 closes https://github.com/official-stockfish/Stockfish/pull/2774 No functional change. --- src/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 492403d3..c3660a20 100644 --- a/src/Makefile +++ b/src/Makefile @@ -344,10 +344,20 @@ endif ### needs access to the optimization flags. ifeq ($(optimize),yes) ifeq ($(debug), no) - ifeq ($(comp),$(filter $(comp),gcc clang mingw)) + ifeq ($(comp),$(filter $(comp),gcc clang)) CXXFLAGS += -flto LDFLAGS += $(CXXFLAGS) endif + +# To use LTO and static linking on windows, the tool chain requires a recent gcc: +# gcc version 10.1 in msys2 or TDM-GCC version 9.2 are know to work, older might not. +# So, only enable it for a cross from Linux by default. + ifeq ($(comp),mingw) + ifeq ($(KERNEL),Linux) + CXXFLAGS += -flto + LDFLAGS += $(CXXFLAGS) + endif + endif endif endif From 96f2541191ae2ed93f7cefeab9ccdead931cc2d4 Mon Sep 17 00:00:00 2001 From: joergoster Date: Sat, 27 Jun 2020 19:41:13 +0200 Subject: [PATCH 4/4] Fix compilation under Linux with -DUSE_SSE41. --- src/eval/nnue/nnue_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/eval/nnue/nnue_common.h b/src/eval/nnue/nnue_common.h index 8ef8fee4..b82bc2c2 100644 --- a/src/eval/nnue/nnue_common.h +++ b/src/eval/nnue/nnue_common.h @@ -7,6 +7,8 @@ #if defined(USE_AVX2) #include +#elif defined(USE_SSE41) +#include #elif defined(USE_SSE2) #include #endif