mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
Speedup sliders attacks for 32bit CPU
Replace a 64 bit 'and' by two 32 bits ones and use unsigned instead of int. This simple patch increases perft speed of 6% on my Intel Core 2 Duo ! No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -30,12 +30,12 @@ CACHE_LINE_ALIGNMENT
|
||||
Bitboard RMasks[64];
|
||||
Bitboard RMagics[64];
|
||||
Bitboard* RAttacks[64];
|
||||
int RShifts[64];
|
||||
unsigned RShifts[64];
|
||||
|
||||
Bitboard BMasks[64];
|
||||
Bitboard BMagics[64];
|
||||
Bitboard* BAttacks[64];
|
||||
int BShifts[64];
|
||||
unsigned BShifts[64];
|
||||
|
||||
Bitboard SquareBB[64];
|
||||
Bitboard FileBB[8];
|
||||
@@ -64,7 +64,7 @@ namespace {
|
||||
typedef unsigned (Fn)(Square, Bitboard);
|
||||
|
||||
void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[],
|
||||
Bitboard masks[], int shifts[], Square deltas[], Fn get_index);
|
||||
Bitboard masks[], unsigned shifts[], Square deltas[], Fn get_index);
|
||||
}
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace {
|
||||
// use the so called "fancy" approach.
|
||||
|
||||
void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[],
|
||||
Bitboard masks[], int shifts[], Square deltas[], Fn get_index) {
|
||||
Bitboard masks[], unsigned shifts[], Square deltas[], Fn get_index) {
|
||||
|
||||
int MagicBoosters[][8] = { { 3191, 2184, 1310, 3618, 2091, 1308, 2452, 3996 },
|
||||
{ 1059, 3608, 605, 3234, 3326, 38, 2029, 3043 } };
|
||||
|
||||
Reference in New Issue
Block a user