definition:
Code: Select all
static INLINE int BSR ( uint64 w )
{
uint64 x;
asm ( "bsrq %1,%0\n": "=&r" ( x ) : "r" ( w ) );
return x;
}
static INLINE int BSF ( uint64 w )
{
uint64 x;
asm ( "bsfq %1,%0\n": "=&r" ( x ) : "r" ( w ) );
return x;
}
Code: Select all
static int WhiteKingDanger ( typePOS* POSITION, int WhiteKings )
{
int e, RankWa, RankWb, RankWc, RankBa, RankBb, RankBc, v, tr = RANK ( WhiteKings );
uint64 T, A = WhiteBishopitboardP & NotInFrontB[tr];
typePAWNptr Z = PAWNptr[FILE ( WhiteKings ) ];
T = A & Z.EDGE;
RankWa = BSF ( T );
if ( !T )
RankWa = 0;
RankWa >>= 3;
T = A & Z.MIDDLE;
RankWb = BSF ( T );
***