Micro optimize extension() in search.cpp

Small micro-optimization in this very
time critical function.

Use bitwise 'or' instead of logic 'or' to avoid branches
in the assembly and use the result to skip an handful of checks.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-07-25 16:16:28 +01:00
parent 1b0303b6e9
commit bdb586ac2b

View File

@@ -2202,8 +2202,10 @@ namespace {
assert(m != MOVE_NONE);
Depth result = Depth(0);
*dangerous = check || singleReply || mateThreat;
*dangerous = check | singleReply | mateThreat;
if (*dangerous)
{
if (check)
result += CheckExtension[pvNode];
@@ -2212,6 +2214,7 @@ namespace {
if (mateThreat)
result += MateThreatExtension[pvNode];
}
if (pos.type_of_piece_on(move_from(m)) == PAWN)
{