]> git.sesse.net Git - stockfish/blobdiff - src/bitboard.h
Evaluate mobility of pinned pieces exactly
[stockfish] / src / bitboard.h
index e0e2fe64545ececedd4acf53852b9fd7e3b7dbf0..deba91d541253de36da806db84afb8cd34b27dce 100644 (file)
@@ -74,6 +74,7 @@ extern Bitboard AdjacentFilesBB[FILE_NB];
 extern Bitboard InFrontBB[COLOR_NB][RANK_NB];
 extern Bitboard StepAttacksBB[PIECE_NB][SQUARE_NB];
 extern Bitboard BetweenBB[SQUARE_NB][SQUARE_NB];
+extern Bitboard LineBB[SQUARE_NB][SQUARE_NB];
 extern Bitboard DistanceRingsBB[SQUARE_NB][8];
 extern Bitboard ForwardBB[COLOR_NB][SQUARE_NB];
 extern Bitboard PassedPawnMask[COLOR_NB][SQUARE_NB];
@@ -319,9 +320,10 @@ extern Square pop_lsb(Bitboard* b);
 
 #endif
 
-/// lsb() overload finds least significant bit relative to the given color
-inline Square lsb(Color c, Bitboard b) {
-  return c == WHITE ? lsb(b) : msb(b);
-}
+/// frontmost_sq() and backmost_sq() find the square corresponding to the
+/// most/least advanced bit relative to the given color.
+
+inline Square frontmost_sq(Color c, Bitboard b) { return c == WHITE ? msb(b) : lsb(b); }
+inline Square  backmost_sq(Color c, Bitboard b) { return c == WHITE ? lsb(b) : msb(b); }
 
 #endif // #ifndef BITBOARD_H_INCLUDED