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:
Marco Costalba
2015-02-07 19:13:41 +01:00
parent 152a4dc5cd
commit 99c9cae586
4 changed files with 9 additions and 9 deletions

View File

@@ -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;