Shortcut see_sign() when SEE is known negative

This patch cuts 30% of SEE calculations, as a drawback
a returned negative value is no more always correct if
a shortcut is found.

This could impact move order when based on negative see
score as example bad captures and evasions.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-10-30 13:34:45 +01:00
parent 23de3e16f1
commit 941d923bf8
3 changed files with 24 additions and 7 deletions

View File

@@ -1171,8 +1171,8 @@ namespace {
Square b8 = relative_square(us, (square_file(s) == FILE_A) ? SQ_B8 : SQ_G8);
if ( pos.piece_on(b6) == piece_of_color_and_type(opposite_color(us), PAWN)
&& pos.see(s, b6) < 0
&& pos.see(s, b8) < 0)
&& pos.see(s, b6, false) < 0
&& pos.see(s, b8, false) < 0)
{
ei.mgValue -= Sign[us] * TrappedBishopA7H7Penalty;
ei.egValue -= Sign[us] * TrappedBishopA7H7Penalty;