mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-23 13:17:12 +00:00
[Passed STC](https://tests.stockfishchess.org/tests/live_elo/691fc321acb6dbdf23d07e4b): ``` LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 215360 W: 55651 L: 55108 D: 104601 Ptnml(0-2): 520, 22399, 61290, 22960, 511 ``` This PR is on top of ces42's work so I'll rebase if that PR changes. Essentially, it comprises my adjustments to `make_index` that remained unmerged before threat inputs was finalized. The unsigned intermediate variables let us skip a bunch of useless sign extensions (because Square and Piece inherit from `int8_t`, and C/C++ semantics require narrow integers to be promoted to `int` before doing arithmetic on them). Additionally, by removing the special usage of `offsets[][64]` and `[65]` the indexing becomes more efficient. (This usage was a temporary hack from sscg anyway, so I think he'll like that it's gone.) Finally, the `sf_assume` condition was fixed so that it actually makes a difference to the compiler. The speedup is fairly nice locally (combining both ces42's and these changes): ``` Result of 100 runs ================== base (...kfish.master) = 1691982 +/- 1907 test (./stockfish ) = 1714349 +/- 1789 diff = +22367 +/- 2465 speedup = +0.0132 P(speedup > 0) = 1.0000 ``` closes https://github.com/official-stockfish/Stockfish/pull/6445 No functional change