hedley
hedley copied to clipboard
Prefetch
I added a HEDLEYX_PREFETCH macro in the experiments branch.
-
__builtin_prefetchfor GCC/clang/ICC -
__pldxand__pldif ACLE is available (every ARM compiler I'm aware of except MSVC, including ARM's) -
_mm_prefetchfor SSE -
__prefetchfor VS targeting ARM,__prefetch2on VS for ARM64 -
sun_prefetch_{read,write)_{once,many}for Oracle Developer Studio -
__prefetch_by_loadon XL C/C++ -
#pragma _CRI prefetch ...on Cray -
#pragma prefetchon PGI
The reason it's not in Hedley right now is that some of the headers we would have to include (xmmintrin.h for SSE, arm_acle.h for ACLE… sun_prefetch.h for ODS isn't really a big deal) are pretty heavy and I'm not sure about the idea of pulling them in unconditionally for a macro I'm not even sure is all that useful.
If anyone has an opinion on including the macro in Hedley I'd be interested, especially if someone wants to do some testing on non-x86 since I have a feeling prefetching may be more important there.