- // Flag the pawn as passed, isolated, doubled or member of a pawn
- // chain (but not the backward one).
- chain = ourPawns & adjacent_files_bb(f) & b;
- isolated = !(ourPawns & adjacent_files_bb(f));
- doubled = ourPawns & forward_bb(Us, s);
- opposed = theirPawns & forward_bb(Us, s);
- passed = !(theirPawns & passed_pawn_mask(Us, s));
+ // Our rank plus previous one
+ b = rank_bb(s) | p;
+
+ // Flag the pawn as passed, isolated, doubled,
+ // unsupported or connected (but not the backward one).
+ connected = ourPawns & adjacent_files_bb(f) & b;
+ unsupported = !(ourPawns & adjacent_files_bb(f) & p);
+ isolated = !(ourPawns & adjacent_files_bb(f));
+ doubled = ourPawns & forward_bb(Us, s);
+ opposed = theirPawns & forward_bb(Us, s);
+ passed = !(theirPawns & passed_pawn_mask(Us, s));