Micro-optimze extension()

Explicitly write the conditions for pawn to 7th
and passed pawn instead of wrapping in redundant
helpers.

Also retire the now unused move_is_pawn_push_to_7th()
and the never used move_was_passed_pawn_push() and
move_is_deep_pawn_push()

Function extension() is so time critical that this
simple patch speeds up the pgo compile of 0.5% and
it is also more clear what actually happens there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-08-24 17:41:24 +01:00
parent 2078878376
commit e217407450
2 changed files with 3 additions and 26 deletions
+3 -2
View File
@@ -2267,12 +2267,13 @@ namespace {
if (pos.type_of_piece_on(move_from(m)) == PAWN)
{
if (pos.move_is_pawn_push_to_7th(m))
Color c = pos.side_to_move();
if (relative_rank(c, move_to(m)) == RANK_7)
{
result += PawnPushTo7thExtension[pvNode];
*dangerous = true;
}
if (pos.move_is_passed_pawn_push(m))
if (pos.pawn_is_passed(c, move_to(m)))
{
result += PassedPawnExtension[pvNode];
*dangerous = true;