From b3470d7ab1d8cfe0bacffc42fc9b30347940b5f4 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 14 Feb 2014 10:43:37 +0100 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitboard.cpp b/src/bitboard.cpp index b7eed922..3df7d425 100644 --- 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; -- 2.39.2