Rearrange prefetch code

No functional change.
This commit is contained in:
Marco Costalba
2012-10-08 11:19:50 +02:00
parent 78fe0cfb8d
commit dae843d4d6
2 changed files with 8 additions and 8 deletions

View File

@@ -227,21 +227,17 @@ void prefetch(char*) {}
#else
# if defined(__INTEL_COMPILER) || defined(__ICL) || defined(_MSC_VER)
# include <xmmintrin.h>
# endif
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
# if defined(__INTEL_COMPILER) || defined(__ICL) || defined(_MSC_VER)
_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);