X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=da4b9c30b41c3e9d3f4ac17641e7a8fcb3f28233;hp=6b329bb0def455471fcf6302f6ce5722de69215a;hb=8fb45caadef67fb2ccc27857c15ade987d9f5e2f;hpb=900279a06f432fbba63b5a320028830b40e06e3e diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 6b329bb0..da4b9c30 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -24,7 +24,7 @@ #include #include -#include "bitcount.h" +#include "bitboard.h" #include "evaluate.h" #include "material.h" #include "pawns.h" @@ -234,7 +234,7 @@ namespace { { ei.kingRing[Them] = b | shift_bb(b); b &= ei.attackedBy[Us][PAWN]; - ei.kingAttackersCount[Us] = b ? popcount(b) : 0; + ei.kingAttackersCount[Us] = b ? popcount(b) : 0; ei.kingAdjacentZoneAttacksCount[Us] = ei.kingAttackersWeight[Us] = 0; } else @@ -278,7 +278,7 @@ namespace { ei.kingAttackersWeight[Us] += KingAttackWeights[Pt]; bb = b & ei.attackedBy[Them][KING]; if (bb) - ei.kingAdjacentZoneAttacksCount[Us] += popcount(bb); + ei.kingAdjacentZoneAttacksCount[Us] += popcount(bb); } if (Pt == QUEEN) @@ -286,7 +286,7 @@ namespace { | ei.attackedBy[Them][BISHOP] | ei.attackedBy[Them][ROOK]); - int mob = popcount(b & mobilityArea[Us]); + int mob = popcount(b & mobilityArea[Us]); mobility[Us] += MobilityBonus[Pt][mob]; @@ -334,7 +334,7 @@ namespace { { Bitboard alignedPawns = pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]; if (alignedPawns) - score += RookOnPawn * popcount(alignedPawns); + score += RookOnPawn * popcount(alignedPawns); } // Bonus when on an open or semi-open file @@ -399,7 +399,7 @@ namespace { // the pawn shelter (current 'score' value). attackUnits = std::min(72, ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) + 9 * ei.kingAdjacentZoneAttacksCount[Them] - + 27 * popcount(undefended) + + 27 * popcount(undefended) + 11 * !!ei.pinnedPieces[Us] - 64 * !pos.count(Them) - mg_value(score) / 8; @@ -415,7 +415,7 @@ namespace { | ei.attackedBy[Them][KING]; if (b) - attackUnits += QueenContactCheck * popcount(b); + attackUnits += QueenContactCheck * popcount(b); } // Analyse the enemy's safe distance checks for sliders and knights @@ -513,7 +513,7 @@ namespace { b = weak & ~ei.attackedBy[Them][ALL_PIECES]; if (b) - score += Hanging * popcount(b); + score += Hanging * popcount(b); b = weak & ei.attackedBy[Us][KING]; if (b) @@ -533,7 +533,7 @@ namespace { & ~ei.attackedBy[Us][PAWN]; if (b) - score += ThreatByPawnPush * popcount(b); + score += ThreatByPawnPush * popcount(b); if (DoTrace) Trace::add(THREAT, Us, score); @@ -656,7 +656,7 @@ namespace { assert(unsigned(safe >> (Us == WHITE ? 32 : 0)) == 0); // ...count safe + (behind & safe) with a single popcount - int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe)); + int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe)); int weight = pos.count(Us) + pos.count(Us) + pos.count(Them) + pos.count(Them);