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

@@ -1691,7 +1691,7 @@ bool Position::pos_is_ok(int* failedStep) const {
// Is there more than 2 checkers?
if (failedStep) (*failedStep)++;
if (debugCheckerCount && count_1s<CNT32>(st->checkersBB) > 2)
if (debugCheckerCount && popcount<Full>(st->checkersBB) > 2)
return false;
// Bitboards OK?
@@ -1760,7 +1760,7 @@ bool Position::pos_is_ok(int* failedStep) const {
if (debugPieceCounts)
for (Color c = WHITE; c <= BLACK; c++)
for (PieceType pt = PAWN; pt <= KING; pt++)
if (pieceCount[c][pt] != count_1s<CNT32>(pieces(pt, c)))
if (pieceCount[c][pt] != popcount<Full>(pieces(pt, c)))
return false;
if (failedStep) (*failedStep)++;