]> git.sesse.net Git - stockfish/commit
Optimize affine transform for SSSE3 and higher targets.
authorTomasz Sobczyk <tomasz.sobczyk1997@gmail.com>
Wed, 28 Oct 2020 23:14:53 +0000 (00:14 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 2 Nov 2020 18:41:17 +0000 (19:41 +0100)
commit75e06a1c89ebac9c9ec4247bc82ec728a2bffe1e
tree4fd2ba9eff94b4488e40e0d7c9f95f91aac05177
parentdfc7f88650bf8bda4a381d36e209209cf63a9bcc
Optimize affine transform for SSSE3 and higher targets.

A non-functional speedup. Unroll the loops going over
the output dimensions in the affine transform layers by
a factor of 4 and perform 4 horizontal additions at a time.
Instead of doing naive horizontal additions on each vector
separately use hadd and shuffling between vectors to reduce
the number of instructions by using all lanes for all stages
of the horizontal adds.

passed STC of the initial version:
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 17808 W: 1914 L: 1756 D: 14138
Ptnml(0-2): 76, 1330, 5948, 1460, 90
https://tests.stockfishchess.org/tests/view/5f9d516f6a2c112b60691da3

passed STC of the final version after cleanup:
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 16296 W: 1750 L: 1595 D: 12951
Ptnml(0-2): 72, 1192, 5479, 1319, 86
https://tests.stockfishchess.org/tests/view/5f9df5776a2c112b60691de3

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

No functional change
src/nnue/layers/affine_transform.h