]> git.sesse.net Git - stockfish/commit
Split branches in generate_piece_moves()
authorMarco Costalba <mcostalba@gmail.com>
Fri, 27 Aug 2010 10:15:07 +0000 (12:15 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 27 Aug 2010 12:28:07 +0000 (13:28 +0100)
commitd9dc9dbd65263f8644afcc1fc632e9201ad20c70
tree68d6c2b295c0cde902d69a96e7c929f8cb3dbeb1
parent2a2353aac65d6f7263081dc373c768c8717602db
Split branches in generate_piece_moves()

Instead of one comparison in while() condition use two,
the first to check if the piece is exsistant and the second
to loop across pieces of that type.

This should help branch prediction in cases we have only
one piece of the same type, for instance for queens, the
first branch is always true and the second is almost always
false.

Increased speed of 0.3-0.5 % on Gcc pgo compiles.

No functional change.

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