1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 09:39:36 +00:00
BadFish/src
Gian-Carlo Pascutto c9977aa0a8 Add AVX-VNNI support for Alder Lake and later.
In their infinite wisdom, Intel axed AVX512 from Alder Lake
chips (well, not entirely, but we kind of want to use the Gracemont
cores for chess!) but still added VNNI support.
Confusingly enough, this is not the same as VNNI256 support.

This adds a specific AVX-VNNI target that will use this AVX-VNNI
mode, by prefixing the VNNI instructions with the appropriate VEX
prefix, and avoiding AVX512 usage.

This is about 1% faster on P cores:

Result of  20 runs
==================
base (./clang-bmi2   ) =    3306337  +/- 7519
test (./clang-vnni   ) =    3344226  +/- 7388
diff                   =     +37889  +/- 4153

speedup        = +0.0115
P(speedup > 0) =  1.0000

But a nice 3% faster on E cores:

Result of  20 runs
==================
base (./clang-bmi2   ) =    1938054  +/- 28257
test (./clang-vnni   ) =    1994606  +/- 31756
diff                   =     +56552  +/- 3735

speedup        = +0.0292
P(speedup > 0) =  1.0000

This was measured on Clang 13. GCC 11.2 appears to generate
worse code for Alder Lake, though the speedup on the E cores
is similar.

It is possible to run the engine specifically on the P or E using binding,
for example in linux it is possible to use (for an 8 P + 8 E setup like i9-12900K):
taskset -c 0-15 ./stockfish
taskset -c 16-23 ./stockfish
where the first call binds to the P-cores and the second to the E-cores.

closes https://github.com/official-stockfish/Stockfish/pull/3824

No functional change
2021-12-03 08:51:06 +01:00
..
incbin Embed default net, and simplify using non-default nets 2020-08-29 21:56:00 +02:00
nnue Fix typos in comments, adjust readme 2021-12-01 18:07:30 +01:00
syzygy Fix typos in comments, adjust readme 2021-12-01 18:07:30 +01:00
benchmark.cpp Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
bitbase.cpp Small cleanups (march 2021) 2021-03-24 17:11:06 +01:00
bitboard.cpp Small clean-up 2021-03-31 08:12:25 +02:00
bitboard.h Small clean-up 2021-03-31 08:12:25 +02:00
endgame.cpp Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
endgame.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
evaluate.cpp Tune NNUE scaling params 2021-11-27 14:26:35 +01:00
evaluate.h Update default net to nn-4f56ecfca5b7.nnue 2021-11-29 12:56:01 +01:00
main.cpp Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
Makefile Add AVX-VNNI support for Alder Lake and later. 2021-12-03 08:51:06 +01:00
material.cpp Small cleanups (march 2021) 2021-03-24 17:11:06 +01:00
material.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
misc.cpp Enable compilation on older Windows systems 2021-11-30 20:57:47 +01:00
misc.h Introduce Optimism 2021-11-21 21:18:08 +01:00
movegen.cpp Simplify Declaration on Pawn Move Generation 2021-08-22 09:15:19 +02:00
movegen.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
movepick.cpp Simplify lowply-history scoring logic 2021-07-23 18:53:03 +02:00
movepick.h Adjust ButterflyHistory decay parameter 2021-10-24 22:17:55 +02:00
pawns.cpp Small cleanups (march 2021) 2021-03-24 17:11:06 +01:00
pawns.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
position.cpp Fix sometimes incorrect key for prefetches 2021-10-25 12:26:44 +02:00
position.h Change trace with NNUE eval support 2021-06-19 11:57:01 +02:00
psqt.cpp Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
psqt.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
search.cpp Correctly reset bestMoveChanges 2021-12-01 18:22:44 +01:00
search.h Tweak initial aspiration window. 2021-11-05 22:22:30 +01:00
simd.h Add AVX-VNNI support for Alder Lake and later. 2021-12-03 08:51:06 +01:00
thread.cpp Small cleanups (march 2021) 2021-03-24 17:11:06 +01:00
thread.h Introduce Optimism 2021-11-21 21:18:08 +01:00
thread_win32_osx.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
timeman.cpp Combo of various parameter tweaks 2021-09-21 19:48:40 +02:00
timeman.h Remove Tempo 2021-05-19 20:34:37 +02:00
tt.cpp Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
tt.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
tune.cpp Remove BoolConditions from tuning code 2021-05-15 09:40:40 +02:00
tune.h Fix typos in comments, adjust readme 2021-12-01 18:07:30 +01:00
types.h Simplify away the Reverse Move penalty 2021-11-08 13:14:18 +01:00
uci.cpp Update WDL model for NNUE 2021-06-28 21:13:30 +02:00
uci.h Add Stockfish namespace. 2021-03-07 14:26:54 +01:00
ucioption.cpp Improve handling of the debug log file. 2021-08-20 07:57:09 +02:00