Generate moves for powerful pieces first
authorMarco Costalba <mcostalba@gmail.com>
Mon, 24 Nov 2008 11:13:08 +0000 (12:13 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 24 Nov 2008 19:43:29 +0000 (20:43 +0100)
This seems to reduce searched nodes by a
surprising 2.5%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movegen.cpp
src/movepick.cpp

index 56caa9a4e583112cb304e6c543e7a39ca6044aa6..7273ca9ad6ebbf50a1aca42734381446a8e948e5 100644 (file)
@@ -122,15 +122,16 @@ int generate_captures(const Position& pos, MoveStack* mlist) {
   Bitboard target = pos.pieces_of_color(opposite_color(us));
   MoveStack* mlist_start = mlist;
 
+  mlist = generate_piece_moves<QUEEN>(pos, mlist, us, target);
+  mlist = generate_piece_moves<ROOK>(pos, mlist, us, target);
+  mlist = generate_piece_moves<BISHOP>(pos, mlist, us, target);
+  mlist = generate_piece_moves<KNIGHT>(pos, mlist, us, target);
+
   if (us == WHITE)
       mlist = generate_pawn_captures<WHITE>(pos, mlist);
   else
       mlist = generate_pawn_captures<BLACK>(pos, mlist);
 
-  mlist = generate_piece_moves<KNIGHT>(pos, mlist, us, target);
-  mlist = generate_piece_moves<BISHOP>(pos, mlist, us, target);
-  mlist = generate_piece_moves<ROOK>(pos, mlist, us, target);
-  mlist = generate_piece_moves<QUEEN>(pos, mlist, us, target);
   mlist = generate_piece_moves<KING>(pos, mlist, us, target);
   return int(mlist - mlist_start);
 }
index 52c1f728ac70b42766ec14bd22d74d3c8017d9f3..ee747c94525cdee18b9f78ea585abd3854cd23e8 100644 (file)
@@ -292,7 +292,6 @@ void MovePicker::score_evasions() {
       } else
           moves[i].score = H.move_ordering_score(pos.piece_on(move_from(m)), m);
   }
-  // FIXME try psqt also here
 }
 
 void MovePicker::score_qcaptures() {