hedley icon indicating copy to clipboard operation
hedley copied to clipboard

Prefetch

Open nemequ opened this issue 6 years ago • 0 comments

I added a HEDLEYX_PREFETCH macro in the experiments branch.

  • __builtin_prefetch for GCC/clang/ICC
  • __pldx and __pld if ACLE is available (every ARM compiler I'm aware of except MSVC, including ARM's)
  • _mm_prefetch for SSE
  • __prefetch for VS targeting ARM, __prefetch2 on VS for ARM64
  • sun_prefetch_{read,write)_{once,many} for Oracle Developer Studio
  • __prefetch_by_load on XL C/C++
  • #pragma _CRI prefetch ... on Cray
  • #pragma prefetch on 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.

nemequ avatar Dec 18 '19 20:12 nemequ