X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=e47e377538bbb6ba6a27c180c80f701e074c38f7;hp=fefa8d4f33cbd2dd7a74ff57f6a481e14468025b;hb=d5e49a3ad44bde500102090e7fe2c19027a73b14;hpb=b50ce5ebfbc9f8b043f0d915c47b0ac550d4affc diff --git a/src/misc.cpp b/src/misc.cpp index fefa8d4f..e47e3775 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2012 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2008-2013 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -227,18 +227,21 @@ void prefetch(char*) {} #else -# include - void prefetch(char* addr) { -# if defined(__INTEL_COMPILER) || defined(__ICL) +# if defined(__INTEL_COMPILER) // This hack prevents prefetches to be optimized away by // Intel compiler. Both MSVC and gcc seems not affected. __asm__ (""); # endif - _mm_prefetch(addr, _MM_HINT_T2); - _mm_prefetch(addr+64, _MM_HINT_T2); // 64 bytes ahead +# if defined(__INTEL_COMPILER) || defined(_MSC_VER) + _mm_prefetch(addr, _MM_HINT_T0); + _mm_prefetch(addr+64, _MM_HINT_T0); // 64 bytes ahead +# else + __builtin_prefetch(addr); + __builtin_prefetch(addr+64); +# endif } #endif