X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=5a4c8b6b82fd6fe5b3330fbbd1d3160ad9352672;hp=ff10b4ff7026524955953dc0d76806b3e32b2d3f;hb=4840643fedbfc33d118cdc13c8435b062e3da99b;hpb=9b30913996355f7d18eb18f1510620380921f1f2 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index ff10b4ff..5a4c8b6b 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -24,8 +24,6 @@ #include "bitcount.h" #include "rkiss.h" -CACHE_LINE_ALIGNMENT - Bitboard RMasks[SQUARE_NB]; Bitboard RMagics[SQUARE_NB]; Bitboard* RAttacks[SQUARE_NB]; @@ -58,8 +56,6 @@ namespace { const uint64_t DeBruijn_64 = 0x3F79D71B4CB0A89ULL; const uint32_t DeBruijn_32 = 0x783A9B23; - CACHE_LINE_ALIGNMENT - int MS1BTable[256]; Square BSFTable[SQUARE_NB]; Bitboard RTable[0x19000]; // Storage space for rook attacks @@ -181,7 +177,7 @@ void Bitboards::init() { for (Square s2 = SQ_A1; s2 <= SQ_H8; ++s2) if (s1 != s2) { - SquareDistance[s1][s2] = std::max(file_distance(s1, s2), rank_distance(s1, s2)); + SquareDistance[s1][s2] = std::max(distance(s1, s2), distance(s1, s2)); DistanceRingsBB[s1][SquareDistance[s1][s2] - 1] |= s2; } @@ -195,7 +191,7 @@ void Bitboards::init() { { Square to = s + Square(c == WHITE ? steps[pt][i] : -steps[pt][i]); - if (is_ok(to) && square_distance(s, to) < 3) + if (is_ok(to) && distance(s, to) < 3) StepAttacksBB[make_piece(c, pt)][s] |= to; } @@ -233,7 +229,7 @@ namespace { for (int i = 0; i < 4; ++i) for (Square s = sq + deltas[i]; - is_ok(s) && square_distance(s, s - deltas[i]) == 1; + is_ok(s) && distance(s, s - deltas[i]) == 1; s += deltas[i]) { attack |= s; @@ -254,9 +250,8 @@ namespace { void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[], Bitboard masks[], unsigned shifts[], Square deltas[], Fn index) { - int MagicBoosters[][8] = { { 969, 1976, 2850, 542, 2069, 2852, 1708, 164 }, - { 3101, 552, 3555, 926, 834, 26, 2131, 1117 } }; - + int MagicBoosters[][RANK_NB] = { { 969, 1976, 2850, 542, 2069, 2852, 1708, 164 }, + { 3101, 552, 3555, 926, 834, 26, 2131, 1117 } }; RKISS rk; Bitboard occupancy[4096], reference[4096], edges, b; int i, size, booster;