mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Branchless correction history with to_sq_unchecked
Add Move::to_sq_unchecked() that bypasses the is_ok() assertion, for use in branchless code paths where invalid moves are masked out. passed STC: LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 92384 W: 24052 L: 23665 D: 44667 Ptnml(0-2): 265, 10229, 24831, 10588, 279 https://tests.stockfishchess.org/tests/view/6974dfc798dc5fff1dba5b74 closes https://github.com/official-stockfish/Stockfish/pull/6569 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
7f85cfbfa2
commit
542c30c292
@@ -449,6 +449,10 @@ class Move {
|
||||
return Square(data & 0x3F);
|
||||
}
|
||||
|
||||
// Same as to_sq() but without assertion, for branchless code paths
|
||||
// where the result is masked/ignored when move is not ok
|
||||
constexpr Square to_sq_unchecked() const { return Square(data & 0x3F); }
|
||||
|
||||
constexpr MoveType type_of() const { return MoveType(data & (3 << 14)); }
|
||||
|
||||
constexpr PieceType promotion_type() const { return PieceType(((data >> 12) & 3) + KNIGHT); }
|
||||
|
||||
Reference in New Issue
Block a user