mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Micro optimize generate_piece_checks() take 2
Add some missing bits of this patch. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -73,8 +73,7 @@ namespace {
|
|||||||
return Us == WHITE ? p << 9 : p >> 7;
|
return Us == WHITE ? p << 9 : p >> 7;
|
||||||
else if (Direction == DELTA_NW)
|
else if (Direction == DELTA_NW)
|
||||||
return Us == WHITE ? p << 7 : p >> 9;
|
return Us == WHITE ? p << 7 : p >> 9;
|
||||||
|
else
|
||||||
assert(false);
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -821,6 +820,11 @@ namespace {
|
|||||||
while (b)
|
while (b)
|
||||||
{
|
{
|
||||||
Square from = pop_1st_bit(&b);
|
Square from = pop_1st_bit(&b);
|
||||||
|
if ( (Piece == QUEEN && !(QueenPseudoAttacks[from] & checkSqs))
|
||||||
|
|| (Piece == ROOK && !(RookPseudoAttacks[from] & checkSqs))
|
||||||
|
|| (Piece == BISHOP && !(BishopPseudoAttacks[from] & checkSqs)))
|
||||||
|
continue;
|
||||||
|
|
||||||
Bitboard bb = pos.piece_attacks<Piece>(from) & checkSqs;
|
Bitboard bb = pos.piece_attacks<Piece>(from) & checkSqs;
|
||||||
SERIALIZE_MOVES(bb);
|
SERIALIZE_MOVES(bb);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user