]> git.sesse.net Git - stockfish/commitdiff
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)
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.


No differences found