Use thread_local compiler specifics

Much faster then pthread_getspecific() but still a
speed regression against the original code.

Following are the nps on a bench:

Position
454165
454838
455433

tls
441046
442767
442767

ms (Win)
450521
447510
451105

ms (pthread)
422115
422115
424276

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-04-06 17:01:41 +01:00
parent bed4075580
commit b1f57e92ce
7 changed files with 17 additions and 24 deletions

View File

@@ -371,7 +371,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
margins[WHITE] = margins[BLACK] = VALUE_ZERO;
// Probe the material hash table
ei.mi = Threads.this_thread()->materialTable.probe(pos);
ei.mi = this_thread->materialTable.probe(pos);
score += ei.mi->material_value();
// If we have a specialized evaluation function for the current material
@@ -383,7 +383,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
}
// Probe the pawn hash table
ei.pi = Threads.this_thread()->pawnTable.probe(pos);
ei.pi = this_thread->pawnTable.probe(pos);
score += ei.pi->pawns_value();
// Initialize attack and king safety bitboards