Add squares attacked by 2 pawns to the attackedBy2 array
STC :
LLR: -2.95 (-2.94,2.94) [0.50,4.50]
Total: 132722 W: 29583 L: 29090 D: 74049
http://tests.stockfishchess.org/tests/view/
5ca231ba0ebc5925cf000794
LTC :
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 94589 W: 16161 L: 15718 D: 62710
http://tests.stockfishchess.org/tests/view/
5ca25d180ebc5925cf000ba4
Bench:
3337864
const Square ksq = pos.square<KING>(Us);
const Square ksq = pos.square<KING>(Us);
+ Bitboard dblAttackByPawn = pawn_double_attacks_bb<Us>(pos.pieces(Us, PAWN));
+
// Find our pawns that are blocked or on the first two ranks
Bitboard b = pos.pieces(Us, PAWN) & (shift<Down>(pos.pieces()) | LowRanks);
// Find our pawns that are blocked or on the first two ranks
Bitboard b = pos.pieces(Us, PAWN) & (shift<Down>(pos.pieces()) | LowRanks);
attackedBy[Us][KING] = pos.attacks_from<KING>(ksq);
attackedBy[Us][PAWN] = pe->pawn_attacks(Us);
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
attackedBy[Us][KING] = pos.attacks_from<KING>(ksq);
attackedBy[Us][PAWN] = pe->pawn_attacks(Us);
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
- attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN];
+ attackedBy2[Us] = (attackedBy[Us][KING] & attackedBy[Us][PAWN])
+ | dblAttackByPawn;
// Init our king safety tables
kingRing[Us] = attackedBy[Us][KING];
// Init our king safety tables
kingRing[Us] = attackedBy[Us][KING];
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
// Remove from kingRing[] the squares defended by two pawns
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
// Remove from kingRing[] the squares defended by two pawns
- kingRing[Us] &= ~pawn_double_attacks_bb<Us>(pos.pieces(Us, PAWN));
+ kingRing[Us] &= ~dblAttackByPawn;