src/bitmask.cpp
int bitscan_reverse(const Bitboard bb) {
#if defined (__GNUC__)
    return __builtin_clzll(bb);
#else
    /**
     * @author Eugene Nalimov
     */
    int result = 0;
    if (bb > 0xFFFFFFFF) {
        bb >>= 32;
        result = 32;
    }
    if (bb > 0xFFFF) {
        bb >>= 16;
        result += 16;
    }
    if (bb > 0xFF) {
        bb >>= 8;
        result += 8;
    }
    return result + ms1bTable[bb];
#endif // __GNUC__
}
/**
 * Determines the index of the most significant 1 bit (MSB1)
 * @param bb bb bitboard to scan
 * @return index of the MSB1
 */
Determines the index of the most significant 1 bit (MSB1)
@param bb bb bitboard to scan
@return index of the MSB1
Determines the index of the most significant 1 bit ( MSB1 ) @param bb bb bitboard to scan @return index of the MSB1
int bitscan_reverse(const Bitboard bb) {
#if defined (__GNUC__)
    return __builtin_clzll(bb);
#else
    int result = 0;
    if (bb > 0xFFFFFFFF) {
        bb >>= 32;
        result = 32;
    }
    if (bb > 0xFFFF) {
        bb >>= 16;
        result += 16;
    }
    if (bb > 0xFF) {
        bb >>= 8;
        result += 8;
    }
    return result + ms1bTable[bb];
#endif 
}
int bitscan_reverse ( const Bitboard bb ) { #if defined ( __GNUC__ ) return __builtin_clzll ( bb ) ; #else int result = 0 ; if ( bb > 0xFFFFFFFF ) { bb >>= 32 ; result = 32 ; } if ( bb > 0xFFFF ) { bb >>= 16 ; result += 16 ; } if ( bb > 0xFF ) { bb >>= 8 ; result += 8 ; } return result + ms1bTable [ bb ] ; #endif }
Determines the index of the most significant 1 bit (MSB1)
 @param bb bb bitboard to scan
 @return index of the MSB1
Determines the index of the most significant 1 bit ( MSB1 ) @param bb bb bitboard to scan @return index of the MSB1
/**
     * @author Eugene Nalimov
     */ // __GNUC__