mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Allow prefetching on non-x86 platforms with gcc
In particular on ARM processors. Original patch by Jean-Francois, sligtly modified by me to preserve the meaning of NO_PREFETCH flag. Verified with gcc, clang and icc that prefetch instruction is correctly created. No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
1ac417edb8
commit
b8948e84b8
@@ -237,8 +237,13 @@ void prefetch(char* addr) {
|
|||||||
__asm__ ("");
|
__asm__ ("");
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if defined(__INTEL_COMPILER) || defined(__ICL) || defined(_MSC_VER)
|
||||||
_mm_prefetch(addr, _MM_HINT_T2);
|
_mm_prefetch(addr, _MM_HINT_T2);
|
||||||
_mm_prefetch(addr+64, _MM_HINT_T2); // 64 bytes ahead
|
_mm_prefetch(addr+64, _MM_HINT_T2); // 64 bytes ahead
|
||||||
|
# else
|
||||||
|
__builtin_prefetch(addr);
|
||||||
|
__builtin_prefetch(addr+64);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user