Simplify popcnt

Also a speedup(about 1%) on 64-bit w/o hardware popcnt

Retire Max15 and Full template parameters
(Contributed by Marco Costalba)

Now that we have just SW and HW versions, use
template default parameter to get rid of explicit
template parameters.

Retire bitcount.h and move the only defined
function to bitboard.h

No functional change

Resolves #620
This commit is contained in:
mstembera
2016-04-08 18:52:15 +01:00
committed by Joona Kiiski
parent 900279a06f
commit 8fb45caade
8 changed files with 60 additions and 129 deletions

View File

@@ -24,7 +24,7 @@
#include <iomanip>
#include <sstream>
#include "bitcount.h"
#include "bitboard.h"
#include "misc.h"
#include "movegen.h"
#include "position.h"
@@ -1170,7 +1170,7 @@ bool Position::pos_is_ok(int* failedStep) const {
for (Color c = WHITE; c <= BLACK; ++c)
for (PieceType pt = PAWN; pt <= KING; ++pt)
{
if (pieceCount[c][pt] != popcount<Full>(pieces(c, pt)))
if (pieceCount[c][pt] != popcount(pieces(c, pt)))
return false;
for (int i = 0; i < pieceCount[c][pt]; ++i)