mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00: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:
parent
1ac417edb8
commit
b8948e84b8
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue