From: Maciej Żenczykowski Date: Sat, 26 Jan 2019 17:16:17 +0000 (-0800) Subject: Use int8_t instead of int for SquareDistance[] X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=8df1cd10df0869f05916d1eb19e33b66127fcb86 Use int8_t instead of int for SquareDistance[] This patch saves (4-1) * 64 * 64 = 12KiB of cache. STC LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 176120 W: 38944 L: 38087 D: 99089 http://tests.stockfishchess.org/tests/view/5c4c9f840ebc593af5d4a7ce LTC As a pure speed up, I've been informed it should not require LTC. No functional change --- diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 77f49ef6..105d201f 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -24,7 +24,7 @@ #include "misc.h" uint8_t PopCnt16[1 << 16]; -int SquareDistance[SQUARE_NB][SQUARE_NB]; +int8_t SquareDistance[SQUARE_NB][SQUARE_NB]; Bitboard SquareBB[SQUARE_NB]; Bitboard FileBB[FILE_NB]; diff --git a/src/bitboard.h b/src/bitboard.h index e1c31dd7..b64c92e1 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -60,7 +60,7 @@ constexpr Bitboard Rank6BB = Rank1BB << (8 * 5); constexpr Bitboard Rank7BB = Rank1BB << (8 * 6); constexpr Bitboard Rank8BB = Rank1BB << (8 * 7); -extern int SquareDistance[SQUARE_NB][SQUARE_NB]; +extern int8_t SquareDistance[SQUARE_NB][SQUARE_NB]; extern Bitboard SquareBB[SQUARE_NB]; extern Bitboard FileBB[FILE_NB];