1
0
Fork 0

Micro optimize generate_piece_checks() take 2

Add some missing bits of this patch.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
sf_2.3.1_base
Marco Costalba 2009-04-19 21:09:53 +02:00
parent f98385e129
commit 24485c96ec
1 changed files with 7 additions and 3 deletions

View File

@ -73,9 +73,8 @@ namespace {
return Us == WHITE ? p << 9 : p >> 7;
else if (Direction == DELTA_NW)
return Us == WHITE ? p << 7 : p >> 9;
assert(false);
return p;
else
return p;
}
// Template generate_piece_checks() with specializations
@ -821,6 +820,11 @@ namespace {
while (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;
SERIALIZE_MOVES(bb);
}