Bitboard RTable[0x19000]; // Storage space for rook attacks
Bitboard BTable[0x1480]; // Storage space for bishop attacks
Bitboard RTable[0x19000]; // Storage space for rook attacks
Bitboard BTable[0x1480]; // Storage space for bishop attacks
- ret = Square(BSFTable[((u.dw.l ^ (u.dw.l - 1)) * 0x783A9B23) >> 26]);
- u.dw.l &= (u.dw.l - 1);
- *bb = u.b;
- return ret;
+ ((b_union*)b)->b.l = u.b.l & (u.b.l - 1);
+ return Square(BSFTable[((u.b.l ^ (u.b.l - 1)) * 0x783A9B23) >> 26]);
- ret = Square(BSFTable[((~(u.dw.h ^ (u.dw.h - 1))) * 0x783A9B23) >> 26]);
- u.dw.h &= (u.dw.h - 1);
- *bb = u.b;
- return ret;
+
+ ((b_union*)b)->b.h = u.b.h & (u.b.h - 1);
+ return Square(BSFTable[((~(u.b.h ^ (u.b.h - 1))) * 0x783A9B23) >> 26]);
/// bitboards_init() initializes various bitboard arrays. It is called during
/// program initialization.
void bitboards_init() {
/// bitboards_init() initializes various bitboard arrays. It is called during
/// program initialization.
void bitboards_init() {