]> git.sesse.net Git - stockfish/commit
Fix magic boosters conversion
authorMarco Costalba <mcostalba@gmail.com>
Fri, 14 Feb 2014 09:43:37 +0000 (10:43 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 14 Feb 2014 09:43:37 +0000 (10:43 +0100)
commitb3470d7ab1d8cfe0bacffc42fc9b30347940b5f4
treeced9c150aff971a57d18033416a340318f3e6c3a
parente4695f15bc62c0e34572b3a995e25b7461d2ae90
Fix magic boosters conversion

Fix small overflow error while converting
magic boosters from right rotate to left rotate,
in particular booster 38 was converted to 4122
instead of the corrcet value 26.

Formula used was:

s1 = original & 63, s2 = (original >> 6) & 63;
new = (64 - s1) | ((64 - s2) << 6);

Instead of:

s1 = original & 63, s2 = (original >> 6) & 63;
new = ((64 - s1) & 63) | (((64 - s2) & 63) << 6);

This has no impact in number of cycles needed, but
just in the resultig number that yields to a rotate
amount bigger than 63.

Spotted by Ehsan Rashid.

No functional change.
src/bitboard.cpp