Unify BitCountType selection

Now that HasPopCnt is a compile time constant we can
centralize and unify the BitCountType selection.

Also rename count_1s() in the more standard popcount()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-12-31 09:46:43 +01:00
parent fb4b4f772e
commit e9296d694c
6 changed files with 50 additions and 44 deletions

View File

@@ -369,7 +369,7 @@ Value Endgame<KBBKN>::operator()(const Position& pos) const {
result += Value(square_distance(bksq, nsq) * 32);
// Bonus for restricting the knight's mobility
result += Value((8 - count_1s<CNT32_MAX15>(pos.attacks_from<KNIGHT>(nsq))) * 8);
result += Value((8 - popcount<Max15>(pos.attacks_from<KNIGHT>(nsq))) * 8);
return strongerSide == pos.side_to_move() ? result : -result;
}