]> git.sesse.net Git - stockfish/commitdiff
Assume network file is in little-endian byte order
authorsyzygy1 <3028851+syzygy1@users.noreply.github.com>
Sat, 15 Aug 2020 14:50:39 +0000 (16:50 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 16 Aug 2020 19:10:26 +0000 (21:10 +0200)
This patch fixes the byte order when reading 16- and 32-bit values from the network file on a big-endian machine.

Bytes are ordered in read_le() using unsigned arithmetic, which doesn't need tricks to determine the endianness of the machine. Unfortunately the compiler doesn't seem to be able to optimise the ordering operation, but reading in the weights is not a time-critical operation and the extra time it takes should not be noticeable.

Big endian systems are still untested with NNUE.

fixes #3007

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

No functional change.


No differences found