Rename first_1 / last_1 in lsb / msb

It seems more accurate: lsb is clear while 'first
bit' depends from where you look at the bitboard.

And fix compile in case of 64 bits platforms that
do not use BSFQ intrinsics.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-07-08 08:30:37 +01:00
parent 67d91dfd50
commit 6b5322ce00
12 changed files with 66 additions and 70 deletions

View File

@@ -25,10 +25,10 @@
/// Simple macro to wrap a very common while loop, no facny, no flexibility,
/// hardcoded names 'mlist' and 'from'.
#define SERIALIZE(b) while (b) (*mlist++).move = make_move(from, pop_1st_bit(&b))
#define SERIALIZE(b) while (b) (*mlist++).move = make_move(from, pop_lsb(&b))
/// Version used for pawns, where the 'from' square is given as a delta from the 'to' square
#define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_1st_bit(&b); \
#define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_lsb(&b); \
(*mlist++).move = make_move(to - (d), to); }
namespace {
@@ -87,7 +87,7 @@ namespace {
while (b)
{
Square to = pop_1st_bit(&b);
Square to = pop_lsb(&b);
if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
(*mlist++).move = make<PROMOTION>(to - Delta, to, QUEEN);
@@ -207,7 +207,7 @@ namespace {
assert(b1);
while (b1)
(*mlist++).move = make<ENPASSANT>(pop_1st_bit(&b1), pos.ep_square());
(*mlist++).move = make<ENPASSANT>(pop_lsb(&b1), pos.ep_square());
}
}
@@ -343,7 +343,7 @@ MoveStack* generate<QUIET_CHECKS>(const Position& pos, MoveStack* mlist) {
while (dc)
{
Square from = pop_1st_bit(&dc);
Square from = pop_lsb(&dc);
PieceType pt = type_of(pos.piece_on(from));
if (pt == PAWN)
@@ -398,7 +398,7 @@ MoveStack* generate<EVASIONS>(const Position& pos, MoveStack* mlist) {
do
{
checkersCnt++;
checksq = pop_1st_bit(&b);
checksq = pop_lsb(&b);
assert(color_of(pos.piece_on(checksq)) == ~us);