Shuffle movepicker score
authorJonathan Calovski <jonoface@live.com.au>
Wed, 23 Apr 2014 03:14:46 +0000 (13:14 +1000)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 24 Apr 2014 06:38:11 +0000 (08:38 +0200)
Believed to be a speed optimization as benched
on Windows with bench realtime affinity 0x1 deleting
highest and lowest runs:

Base Test
1549259 1608202
1538115 1583934
1543168 1556938
1536365 1554179
1533026 1582010

Signature remains unchanged and gives anywhere from 1-2% nps
boost in analysis depending on number of cores used.

No functional change.

src/movepick.cpp

index ce603d188ce5ad3d5e7add57ac1b00c4c2d599e8..0c61c30c07ef937e75bfc7af63c8d2e6343d6751 100644 (file)
@@ -167,11 +167,11 @@ void MovePicker::score<CAPTURES>() {
       it->value =  PieceValue[MG][pos.piece_on(to_sq(m))]
                  - Value(type_of(pos.moved_piece(m)));
 
-      if (type_of(m) == PROMOTION)
-          it->value += PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN];
-
-      else if (type_of(m) == ENPASSANT)
+      if (type_of(m) == ENPASSANT)
           it->value += PieceValue[MG][PAWN];
+
+      else if (type_of(m) == PROMOTION)
+          it->value += PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN];
   }
 }