Compute simplified HQ r/rr at runtime

Hyperbola Quintessence works out without the "... * 2" in r and rr. This then is cheap enough to compute at runtime, instead of looking it up, for a minor speedup.

Passed apple-silicon|armv8|loongarch64 STC:
https://tests.stockfishchess.org/tests/view/6a15f031818cacc1db0aca49
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 410208 W: 104369 L: 103556 D: 202283
Ptnml(0-2): 758, 43951, 114883, 44744, 768

Verified attacks_bb<ROOK>() and attacks_bb<BISHOP>() assembly remains unchanged on x86 (gcc 16.1.1).

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

No functional change
This commit is contained in:
Niklas Fiekas
2026-06-06 10:04:39 +02:00
committed by Joost VandeVondele
parent db6cba47d6
commit 9eb836b3b5
2 changed files with 7 additions and 12 deletions
-3
View File
@@ -69,9 +69,6 @@ static void init_magics(Magic magics[][2]) {
Magic& bishop = magics[s][BISHOP - BISHOP];
bishop.mask1 = line_mask(s, NORTH_EAST, SOUTH_WEST);
bishop.mask2 = line_mask(s, NORTH_WEST, SOUTH_EAST);
rook.r = bishop.r = square_bb(s) * 2;
rook.rr = bishop.rr = square_bb(Square(63 - int(s))) * 2;
}
}