Introduce bitcount.h

It will be used for POPCNT intrinsics.

For now no bianry and functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-05-21 15:29:28 +02:00
parent 1b0888708d
commit 3376c68f4b
8 changed files with 192 additions and 90 deletions

View File

@@ -25,6 +25,7 @@
#include <cassert>
#include "bitbase.h"
#include "bitcount.h"
#include "endgame.h"
@@ -377,7 +378,7 @@ Value EvaluationFunction<KBBKN>::apply(const Position& pos) {
result += Value(square_distance(bksq, nsq) * 32);
// Bonus for restricting the knight's mobility
result += Value((8 - count_1s_max_15(pos.piece_attacks<KNIGHT>(nsq))) * 8);
result += Value((8 - count_1s_max_15<false>(pos.piece_attacks<KNIGHT>(nsq))) * 8);
return (strongerSide == pos.side_to_move() ? result : -result);
}