Introduce see_sign() and use it to shortcut full see()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 11 Jul 2009 08:54:30 +0000 (09:54 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 12 Jul 2009 07:37:43 +0000 (08:37 +0100)
commit2a461b4b745b2542f6e13bab8c60abdb366bc128
tree6995b4426ed59fe720fcaaed1e35bce48c10466b
parent6f39a3fc8071f40289d9599616490014c2321a48
Introduce see_sign() and use it to shortcut full see()

Mostly of times we are interested only in the sign of SEE,
namely if a capture is negative or not.

If the capturing piece is smaller then the captured one we
already know SEE cannot be negative and this information
is enough most of the times. And of course it is much
faster to detect then a full SEE.

Note that in case see_sign() is negative then the returned
value is exactly the see() value, this is very important,
especially for ordering capturing moves.

With this patch the calls to the costly see() are reduced
of almost 30%.

No functional change.

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