bb: millTableBB: Use SN() macron
This commit is contained in:
parent
9d3a6b9fa1
commit
21f5abb803
|
@ -60,8 +60,6 @@ void Bitboards::init()
|
||||||
for (Square s = SQ_BEGIN; s < SQ_END; ++s)
|
for (Square s = SQ_BEGIN; s < SQ_END; ++s)
|
||||||
SquareBB[s] = (1UL << s);
|
SquareBB[s] = (1UL << s);
|
||||||
|
|
||||||
#define S4(a, b, c, d) (square_bb(SQ_##a) | square_bb(SQ_##b) | square_bb(SQ_##c) | square_bb(SQ_##d))
|
|
||||||
StarSquareBB9 = S4(16, 18, 20, 22);
|
StarSquareBB9 = S4(16, 18, 20, 22);
|
||||||
StarSquareBB12 = S4(17, 19, 21, 23);
|
StarSquareBB12 = S4(17, 19, 21, 23);
|
||||||
#undef S4
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
#define SET_BIT(x, bit) (x |= (1 << bit))
|
#define SET_BIT(x, bit) (x |= (1 << bit))
|
||||||
#define CLEAR_BIT(x, bit) (x &= ~(1 << bit))
|
#define CLEAR_BIT(x, bit) (x &= ~(1 << bit))
|
||||||
|
|
||||||
|
#define S2(a, b) (square_bb(SQ_##a) | square_bb(SQ_##b))
|
||||||
|
#define S3(a, b, c) (square_bb(SQ_##a) | square_bb(SQ_##b) | square_bb(SQ_##c))
|
||||||
|
#define S4(a, b, c, d) (square_bb(SQ_##a) | square_bb(SQ_##b) | square_bb(SQ_##c) | square_bb(SQ_##d))
|
||||||
|
#define S4(a, b, c, d) (square_bb(SQ_##a) | square_bb(SQ_##b) | square_bb(SQ_##c) | square_bb(SQ_##d))
|
||||||
|
|
||||||
namespace Bitboards
|
namespace Bitboards
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,6 @@ void adjacent_squares_init()
|
||||||
/* 39 */ {0, 0, 0, 0},
|
/* 39 */ {0, 0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define S2(a, b) (square_bb(SQ_##a) | square_bb(SQ_##b))
|
|
||||||
#define S3(a, b, c) (square_bb(SQ_##a) | square_bb(SQ_##b) | square_bb(SQ_##c))
|
|
||||||
#define S4(a, b, c, d) (square_bb(SQ_##a) | square_bb(SQ_##b) | square_bb(SQ_##c) | square_bb(SQ_##d))
|
|
||||||
|
|
||||||
const Bitboard adjacentSquaresBB12[SQUARE_NB] = {
|
const Bitboard adjacentSquaresBB12[SQUARE_NB] = {
|
||||||
/* 0 */ 0,
|
/* 0 */ 0,
|
||||||
/* 1 */ 0,
|
/* 1 */ 0,
|
||||||
|
@ -240,10 +236,6 @@ void adjacent_squares_init()
|
||||||
/* 39 */ 0,
|
/* 39 */ 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef S2
|
|
||||||
#undef S3
|
|
||||||
#undef S4
|
|
||||||
|
|
||||||
if (rule.hasObliqueLines) {
|
if (rule.hasObliqueLines) {
|
||||||
memcpy(MoveList<LEGAL>::adjacentSquares, adjacentSquares12, sizeof(MoveList<LEGAL>::adjacentSquares));
|
memcpy(MoveList<LEGAL>::adjacentSquares, adjacentSquares12, sizeof(MoveList<LEGAL>::adjacentSquares));
|
||||||
memcpy(MoveList<LEGAL>::adjacentSquaresBB, adjacentSquaresBB12, sizeof(MoveList<LEGAL>::adjacentSquaresBB));
|
memcpy(MoveList<LEGAL>::adjacentSquaresBB, adjacentSquaresBB12, sizeof(MoveList<LEGAL>::adjacentSquaresBB));
|
||||||
|
|
|
@ -1097,32 +1097,32 @@ void Position::create_mill_table()
|
||||||
/* 6 */ {0, 0, 0},
|
/* 6 */ {0, 0, 0},
|
||||||
/* 7 */ {0, 0, 0},
|
/* 7 */ {0, 0, 0},
|
||||||
|
|
||||||
/* 8 */ {square_bb(SQ_16) | square_bb(SQ_24), square_bb(SQ_9) | square_bb(SQ_15), ~0U},
|
/* 8 */ {S2(16, 24), S2(9, 15), ~0U},
|
||||||
/* 9 */ {~0U, square_bb(SQ_15) | square_bb(SQ_8), square_bb(SQ_10) | square_bb(SQ_11)},
|
/* 9 */ {~0U, S2(15, 8), S2(10, 11)},
|
||||||
/* 10 */ {square_bb(SQ_18) | square_bb(SQ_26), square_bb(SQ_11) | square_bb(SQ_9), ~0U},
|
/* 10 */ {S2(18, 26), S2(11, 9), ~0U},
|
||||||
/* 11 */ {~0U, square_bb(SQ_9) | square_bb(SQ_10), square_bb(SQ_12) | square_bb(SQ_13)},
|
/* 11 */ {~0U, S2(9, 10), S2(12, 13)},
|
||||||
/* 12 */ {square_bb(SQ_20) | square_bb(SQ_28), square_bb(SQ_13) | square_bb(SQ_11), ~0U},
|
/* 12 */ {S2(20, 28), S2(13, 11), ~0U},
|
||||||
/* 13 */ {~0U, square_bb(SQ_11) | square_bb(SQ_12), square_bb(SQ_14) | square_bb(SQ_15)},
|
/* 13 */ {~0U, S2(11, 12), S2(14, 15)},
|
||||||
/* 14 */ {square_bb(SQ_22) | square_bb(SQ_30), square_bb(SQ_15) | square_bb(SQ_13), ~0U},
|
/* 14 */ {S2(22, 30), S2(15, 13), ~0U},
|
||||||
/* 15 */ {~0U, square_bb(SQ_13) | square_bb(SQ_14), square_bb(SQ_8) | square_bb(SQ_9)},
|
/* 15 */ {~0U, S2(13, 14), S2(8, 9)},
|
||||||
|
|
||||||
/* 16 */ {square_bb(SQ_8) | square_bb(SQ_24), square_bb(SQ_17) | square_bb(SQ_23), ~0U},
|
/* 16 */ {S2(8, 24), S2(17, 23), ~0U},
|
||||||
/* 17 */ {~0U, square_bb(SQ_23) | square_bb(SQ_16), square_bb(SQ_18) | square_bb(SQ_19)},
|
/* 17 */ {~0U, S2(23, 16), S2(18, 19)},
|
||||||
/* 18 */ {square_bb(SQ_10) | square_bb(SQ_26), square_bb(SQ_19) | square_bb(SQ_17), ~0U},
|
/* 18 */ {S2(10, 26), S2(19, 17), ~0U},
|
||||||
/* 19 */ {~0U, square_bb(SQ_17) | square_bb(SQ_18), square_bb(SQ_20) | square_bb(SQ_21)},
|
/* 19 */ {~0U, S2(17, 18), S2(20, 21)},
|
||||||
/* 20 */ {square_bb(SQ_12) | square_bb(SQ_28), square_bb(SQ_21) | square_bb(SQ_19), ~0U},
|
/* 20 */ {S2(12, 28), S2(21, 19), ~0U},
|
||||||
/* 21 */ {~0U, square_bb(SQ_19) | square_bb(SQ_20), square_bb(SQ_22) | square_bb(SQ_23)},
|
/* 21 */ {~0U, S2(19, 20), S2(22, 23)},
|
||||||
/* 22 */ {square_bb(SQ_14) | square_bb(SQ_30), square_bb(SQ_23) | square_bb(SQ_21), ~0U},
|
/* 22 */ {S2(14, 30), S2(23, 21), ~0U},
|
||||||
/* 23 */ {~0U, square_bb(SQ_21) | square_bb(SQ_22), square_bb(SQ_16) | square_bb(SQ_17)},
|
/* 23 */ {~0U, S2(21, 22), S2(16, 17)},
|
||||||
|
|
||||||
/* 24 */ {square_bb(SQ_8) | square_bb(SQ_16), square_bb(SQ_25) | square_bb(SQ_31), ~0U},
|
/* 24 */ {S2(8, 16), S2(25, 31), ~0U},
|
||||||
/* 25 */ {~0U, square_bb(SQ_31) | square_bb(SQ_24), square_bb(SQ_26) | square_bb(SQ_27)},
|
/* 25 */ {~0U, S2(31, 24), S2(26, 27)},
|
||||||
/* 26 */ {square_bb(SQ_10) | square_bb(SQ_18), square_bb(SQ_27) | square_bb(SQ_25), ~0U},
|
/* 26 */ {S2(10, 18), S2(27, 25), ~0U},
|
||||||
/* 27 */ {~0U, square_bb(SQ_25) | square_bb(SQ_26), square_bb(SQ_28) | square_bb(SQ_29)},
|
/* 27 */ {~0U, S2(25, 26), S2(28, 29)},
|
||||||
/* 28 */ {square_bb(SQ_12) | square_bb(SQ_20), square_bb(SQ_29) | square_bb(SQ_27), ~0U},
|
/* 28 */ {S2(12, 20), S2(29, 27), ~0U},
|
||||||
/* 29 */ {~0U, square_bb(SQ_27) | square_bb(SQ_28), square_bb(SQ_30) | square_bb(SQ_31)},
|
/* 29 */ {~0U, S2(27, 28), S2(30, 31)},
|
||||||
/* 30 */ {square_bb(SQ_14) | square_bb(SQ_22), square_bb(SQ_31) | square_bb(SQ_29), ~0U},
|
/* 30 */ {S2(14, 22), S2(31, 29), ~0U},
|
||||||
/* 31 */ {~0U, square_bb(SQ_29) | square_bb(SQ_30), square_bb(SQ_24) | square_bb(SQ_25)},
|
/* 31 */ {~0U, S2(29, 30), S2(24, 25)},
|
||||||
|
|
||||||
/* 32 */ {0, 0, 0},
|
/* 32 */ {0, 0, 0},
|
||||||
/* 33 */ {0, 0, 0},
|
/* 33 */ {0, 0, 0},
|
||||||
|
@ -1144,32 +1144,32 @@ void Position::create_mill_table()
|
||||||
/* 6 */ {0, 0, 0},
|
/* 6 */ {0, 0, 0},
|
||||||
/* 7 */ {0, 0, 0},
|
/* 7 */ {0, 0, 0},
|
||||||
|
|
||||||
/* 8 */ {square_bb(SQ_16) | square_bb(SQ_24), square_bb(SQ_9) | square_bb(SQ_15), ~0U},
|
/* 8 */ {S2(16, 24), S2(9, 15), ~0U},
|
||||||
/* 9 */ {square_bb(SQ_17) | square_bb(SQ_25), square_bb(SQ_15) | square_bb(SQ_8), square_bb(SQ_10) | square_bb(SQ_11)},
|
/* 9 */ {S2(17, 25), S2(15, 8), S2(10, 11)},
|
||||||
/* 10 */ {square_bb(SQ_18) | square_bb(SQ_26), square_bb(SQ_11) | square_bb(SQ_9), ~0U},
|
/* 10 */ {S2(18, 26), S2(11, 9), ~0U},
|
||||||
/* 11 */ {square_bb(SQ_19) | square_bb(SQ_27), square_bb(SQ_9) | square_bb(SQ_10), square_bb(SQ_12) | square_bb(SQ_13)},
|
/* 11 */ {S2(19, 27), S2(9, 10), S2(12, 13)},
|
||||||
/* 12 */ {square_bb(SQ_20) | square_bb(SQ_28), square_bb(SQ_13) | square_bb(SQ_11), ~0U},
|
/* 12 */ {S2(20, 28), S2(13, 11), ~0U},
|
||||||
/* 13 */ {square_bb(SQ_21) | square_bb(SQ_29), square_bb(SQ_11) | square_bb(SQ_12), square_bb(SQ_14) | square_bb(SQ_15)},
|
/* 13 */ {S2(21, 29), S2(11, 12), S2(14, 15)},
|
||||||
/* 14 */ {square_bb(SQ_22) | square_bb(SQ_30), square_bb(SQ_15) | square_bb(SQ_13), ~0U},
|
/* 14 */ {S2(22, 30), S2(15, 13), ~0U},
|
||||||
/* 15 */ {square_bb(SQ_23) | square_bb(SQ_31), square_bb(SQ_13) | square_bb(SQ_14), square_bb(SQ_8) | square_bb(SQ_9)},
|
/* 15 */ {S2(23, 31), S2(13, 14), S2(8, 9)},
|
||||||
|
|
||||||
/* 16 */ {square_bb(SQ_8) | square_bb(SQ_24), square_bb(SQ_17) | square_bb(SQ_23), ~0U},
|
/* 16 */ {S2(8, 24), S2(17, 23), ~0U},
|
||||||
/* 17 */ {square_bb(SQ_9) | square_bb(SQ_25), square_bb(SQ_23) | square_bb(SQ_16), square_bb(SQ_18) | square_bb(SQ_19)},
|
/* 17 */ {S2(9, 25), S2(23, 16), S2(18, 19)},
|
||||||
/* 18 */ {square_bb(SQ_10) | square_bb(SQ_26), square_bb(SQ_19) | square_bb(SQ_17), ~0U},
|
/* 18 */ {S2(10, 26), S2(19, 17), ~0U},
|
||||||
/* 19 */ {square_bb(SQ_11) | square_bb(SQ_27), square_bb(SQ_17) | square_bb(SQ_18), square_bb(SQ_20) | square_bb(SQ_21)},
|
/* 19 */ {S2(11, 27), S2(17, 18), S2(20, 21)},
|
||||||
/* 20 */ {square_bb(SQ_12) | square_bb(SQ_28), square_bb(SQ_21) | square_bb(SQ_19), ~0U},
|
/* 20 */ {S2(12, 28), S2(21, 19), ~0U},
|
||||||
/* 21 */ {square_bb(SQ_13) | square_bb(SQ_29), square_bb(SQ_19) | square_bb(SQ_20), square_bb(SQ_22) | square_bb(SQ_23)},
|
/* 21 */ {S2(13, 29), S2(19, 20), S2(22, 23)},
|
||||||
/* 22 */ {square_bb(SQ_14) | square_bb(SQ_30), square_bb(SQ_23) | square_bb(SQ_21), ~0U},
|
/* 22 */ {S2(14, 30), S2(23, 21), ~0U},
|
||||||
/* 23 */ {square_bb(SQ_15) | square_bb(SQ_31), square_bb(SQ_21) | square_bb(SQ_22), square_bb(SQ_16) | square_bb(SQ_17)},
|
/* 23 */ {S2(15, 31), S2(21, 22), S2(16, 17)},
|
||||||
|
|
||||||
/* 24 */ {square_bb(SQ_8) | square_bb(SQ_16), square_bb(SQ_25) | square_bb(SQ_31), ~0U},
|
/* 24 */ {S2(8, 16), S2(25, 31), ~0U},
|
||||||
/* 25 */ {square_bb(SQ_9) | square_bb(SQ_17), square_bb(SQ_31) | square_bb(SQ_24), square_bb(SQ_26) | square_bb(SQ_27)},
|
/* 25 */ {S2(9, 17), S2(31, 24), S2(26, 27)},
|
||||||
/* 26 */ {square_bb(SQ_10) | square_bb(SQ_18), square_bb(SQ_27) | square_bb(SQ_25), ~0U},
|
/* 26 */ {S2(10, 18), S2(27, 25), ~0U},
|
||||||
/* 27 */ {square_bb(SQ_11) | square_bb(SQ_19), square_bb(SQ_25) | square_bb(SQ_26), square_bb(SQ_28) | square_bb(SQ_29)},
|
/* 27 */ {S2(11, 19), S2(25, 26), S2(28, 29)},
|
||||||
/* 28 */ {square_bb(SQ_12) | square_bb(SQ_20), square_bb(SQ_29) | square_bb(SQ_27), ~0U},
|
/* 28 */ {S2(12, 20), S2(29, 27), ~0U},
|
||||||
/* 29 */ {square_bb(SQ_13) | square_bb(SQ_21), square_bb(SQ_27) | square_bb(SQ_28), square_bb(SQ_30) | square_bb(SQ_31)},
|
/* 29 */ {S2(13, 21), S2(27, 28), S2(30, 31)},
|
||||||
/* 30 */ {square_bb(SQ_14) | square_bb(SQ_22), square_bb(SQ_31) | square_bb(SQ_29), ~0U},
|
/* 30 */ {S2(14, 22), S2(31, 29), ~0U},
|
||||||
/* 31 */ {square_bb(SQ_15) | square_bb(SQ_23), square_bb(SQ_29) | square_bb(SQ_30), square_bb(SQ_24) | square_bb(SQ_25)},
|
/* 31 */ {S2(15, 23), S2(29, 30), S2(24, 25)},
|
||||||
|
|
||||||
/* 32 */ {0, 0, 0},
|
/* 32 */ {0, 0, 0},
|
||||||
/* 33 */ {0, 0, 0},
|
/* 33 */ {0, 0, 0},
|
||||||
|
|
Loading…
Reference in New Issue