mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 15:37:47 +00:00
Optimize accumulators for null move.
This commit is contained in:
+5
-6
@@ -999,21 +999,20 @@ void Position::do_null_move(StateInfo& newSt) {
|
|||||||
assert(!checkers());
|
assert(!checkers());
|
||||||
assert(&newSt != st);
|
assert(&newSt != st);
|
||||||
|
|
||||||
if (Eval::useNNUE != Eval::UseNNUEMode::False)
|
|
||||||
{
|
|
||||||
std::memcpy(&newSt, st, sizeof(StateInfo));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
std::memcpy(&newSt, st, offsetof(StateInfo, accumulator));
|
std::memcpy(&newSt, st, offsetof(StateInfo, accumulator));
|
||||||
|
|
||||||
newSt.previous = st;
|
newSt.previous = st;
|
||||||
st = &newSt;
|
st = &newSt;
|
||||||
|
|
||||||
|
// Used by NNUE
|
||||||
|
st->accumulator.computed_accumulation = false;
|
||||||
|
auto& dp = st->dirtyPiece;
|
||||||
|
dp.dirty_num = 0;
|
||||||
|
|
||||||
if (st->epSquare != SQ_NONE)
|
if (st->epSquare != SQ_NONE)
|
||||||
{
|
{
|
||||||
st->key ^= Zobrist::enpassant[file_of(st->epSquare)];
|
st->key ^= Zobrist::enpassant[file_of(st->epSquare)];
|
||||||
st->epSquare = SQ_NONE;
|
st->epSquare = SQ_NONE;
|
||||||
st->accumulator.computed_accumulation = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
st->key ^= Zobrist::side;
|
st->key ^= Zobrist::side;
|
||||||
|
|||||||
Reference in New Issue
Block a user