projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
e4695f1
)
Fix magic boosters conversion
author
Marco Costalba
<mcostalba@gmail.com>
Fri, 14 Feb 2014 09:43:37 +0000 (10:43 +0100)
committer
Marco 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.
src/bitboard.cpp
patch
|
blob
|
history
diff --git
a/src/bitboard.cpp
b/src/bitboard.cpp
index
b7eed92
..
3df7d42
100644
(file)
--- a/
src/bitboard.cpp
+++ b/
src/bitboard.cpp
@@
-255,7
+255,7
@@
namespace {
Bitboard masks[], unsigned shifts[], Square deltas[], Fn index) {
int MagicBoosters[][8] = { { 969, 1976, 2850, 542, 2069, 2852, 1708, 164 },
- { 3101, 552, 3555, 926, 834, 4122, 2131, 1117 } };
+ { 3101, 552, 3555, 926, 834, 26, 2131, 1117 } };
RKISS rk;
Bitboard occupancy[4096], reference[4096], edges, b;