Compute SplitPoint::spLevel on the fly

And retire a redundant field. This is important also
from a concept point of view becuase we want to keep
SMP structures as simple as possible with the only
strictly necessary data.

Verified with

dbg_hit_on(sp->spLevel != level)

that the values are 100% the same out of more 50K samples.

No functional change.
This commit is contained in:
Marco Costalba
2015-02-17 10:10:58 +01:00
parent 6656ed8904
commit dccaa145d2
3 changed files with 8 additions and 5 deletions

View File

@@ -154,7 +154,6 @@ void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bes
sp.masterThread = this;
sp.parentSplitPoint = activeSplitPoint;
sp.spLevel = activeSplitPoint ? activeSplitPoint->spLevel + 1 : 0;
sp.slavesMask = 0, sp.slavesMask.set(idx);
sp.slavesCount = 1;
sp.depth = depth;
@@ -184,7 +183,7 @@ void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bes
Thread* slave;
while ( sp.slavesCount < MAX_SLAVES_PER_SPLITPOINT
while ( sp.slavesCount < MAX_SLAVES_PER_SPLITPOINT
&& (slave = Threads.available_slave(this)) != NULL)
{
sp.slavesMask.set(slave->idx);