mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Avoid casting to char* in prefetch()
Funny enough, gcc __builtin_prefetch() expects already a void*, instead Windows's _mm_prefetch() requires a char*. The patch allows to remove ugly casts from caller sites. No functional change.
This commit is contained in:
@@ -774,7 +774,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
|
||||
// Update material hash key and prefetch access to materialTable
|
||||
k ^= Zobrist::psq[them][captured][capsq];
|
||||
st->materialKey ^= Zobrist::psq[them][captured][pieceCount[them][captured]];
|
||||
prefetch((char*)thisThread->materialTable[st->materialKey]);
|
||||
prefetch(thisThread->materialTable[st->materialKey]);
|
||||
|
||||
// Update incremental scores
|
||||
st->psq -= psq[them][captured][capsq];
|
||||
@@ -841,7 +841,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
|
||||
|
||||
// Update pawn hash key and prefetch access to pawnsTable
|
||||
st->pawnKey ^= Zobrist::psq[us][PAWN][from] ^ Zobrist::psq[us][PAWN][to];
|
||||
prefetch((char*)thisThread->pawnsTable[st->pawnKey]);
|
||||
prefetch(thisThread->pawnsTable[st->pawnKey]);
|
||||
|
||||
// Reset rule 50 draw counter
|
||||
st->rule50 = 0;
|
||||
@@ -988,7 +988,7 @@ void Position::do_null_move(StateInfo& newSt) {
|
||||
}
|
||||
|
||||
st->key ^= Zobrist::side;
|
||||
prefetch((char*)TT.first_entry(st->key));
|
||||
prefetch(TT.first_entry(st->key));
|
||||
|
||||
++st->rule50;
|
||||
st->pliesFromNull = 0;
|
||||
|
||||
Reference in New Issue
Block a user