mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user