-/// Functions for computing sliding attack bitboards. rook_attacks_bb(),
-/// bishop_attacks_bb() and queen_attacks_bb() all take a square and a
-/// bitboard of occupied squares as input, and return a bitboard representing
-/// all squares attacked by a rook, bishop or queen on the given square.
-
-#if defined(IS_64BIT)
-
-FORCE_INLINE unsigned rook_index(Square s, Bitboard occ) {
- return unsigned(((occ & RMasks[s]) * RMagics[s]) >> RShifts[s]);
-}
-
-FORCE_INLINE unsigned bishop_index(Square s, Bitboard occ) {
- return unsigned(((occ & BMasks[s]) * BMagics[s]) >> BShifts[s]);
-}
-
-#else // if !defined(IS_64BIT)
-
-FORCE_INLINE unsigned rook_index(Square s, Bitboard occ) {
- Bitboard b = occ & RMasks[s];
- return unsigned(int(b) * int(RMagics[s]) ^ int(b >> 32) * int(RMagics[s] >> 32)) >> RShifts[s];
-}
-
-FORCE_INLINE unsigned bishop_index(Square s, Bitboard occ) {
- Bitboard b = occ & BMasks[s];
- return unsigned(int(b) * int(BMagics[s]) ^ int(b >> 32) * int(BMagics[s] >> 32)) >> BShifts[s];
-}
-#endif
-
-inline Bitboard rook_attacks_bb(Square s, Bitboard occ) {
- return RAttacks[s][rook_index(s, occ)];
-}
-
-inline Bitboard bishop_attacks_bb(Square s, Bitboard occ) {
- return BAttacks[s][bishop_index(s, occ)];
-}
-
-inline Bitboard queen_attacks_bb(Square s, Bitboard blockers) {
- return rook_attacks_bb(s, blockers) | bishop_attacks_bb(s, blockers);
-}
-
-
-/// squares_between returns a bitboard representing all squares between
-/// two squares. For instance, squares_between(SQ_C4, SQ_F7) returns a
-/// bitboard with the bits for square d5 and e6 set. If s1 and s2 are not
-/// on the same line, file or diagonal, EmptyBoardBB is returned.