X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=9704839408e8ad7d9698222ecb2b664d0235cc53;hp=7f0fdb5a86a3029bd2f677b9f772a591ce79c3aa;hb=927f1b0bd30a5b2cfdcdf163f26f528738509064;hpb=a617b038759f6abd1b33f71ef6d1938fa3588c3d diff --git a/src/bitboard.h b/src/bitboard.h index 7f0fdb5a..97048394 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -53,7 +53,7 @@ extern Bitboard InFrontBB[2][8]; extern Bitboard SetMaskBB[65]; extern Bitboard ClearMaskBB[65]; -extern Bitboard NonSlidingAttacksBB[16][64]; +extern Bitboard StepAttacksBB[16][64]; extern Bitboard BetweenBB[64][64]; extern Bitboard SquaresInFrontMask[2][64]; @@ -257,15 +257,25 @@ inline bool squares_aligned(Square s1, Square s2, Square s3) { /// pop_1st_bit() finds and clears the least significant nonzero bit in a /// nonzero bitboard. -#if defined(USE_BSFQ) // Assembly code by Heinz van Saanen +#if defined(USE_BSFQ) -inline Square first_1(Bitboard b) { +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) + +FORCE_INLINE Square first_1(Bitboard b) { + unsigned long index; + _BitScanForward64(&index, b); + return (Square) index; +} +#else + +FORCE_INLINE Square first_1(Bitboard b) { // Assembly code by Heinz van Saanen Bitboard dummy; __asm__("bsfq %1, %0": "=r"(dummy): "rm"(b) ); - return (Square)(dummy); + return (Square) dummy; } +#endif -inline Square pop_1st_bit(Bitboard* b) { +FORCE_INLINE Square pop_1st_bit(Bitboard* b) { const Square s = first_1(*b); *b &= ~(1ULL<