Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
117 Views

hardware prefetching programmatically

Jump to solution

We know how to perform software prefetching using C++ intrinsics.

As for hardware prefetching to improve cache performance, Chapter 8 in the document Intel 64 and IA-32 Architectures Optimization Reference Manual shows how to do that using inline asm. Following that suggestion, we could use the following inline assembly to hw prefect 512 bytes (where, alternatively, mov r9 can be replaced by vmovaps ymm0):

 

inline void Prefetch512_HW(void* address)
{
 _asm {
       mov rsi, address
       mov r9, [rsi]
       mov r9, [rsi+64]
       mov r9, [rsi+128]
       mov r9, [rsi+192]
       mov r9, [rsi+256]
       mov r9, [rsi+320]
       mov r9, [rsi+384]
       mov r9, [rsi+448]
      }
}

 

  1. Is there a lighter (faster) way to attain the same goal? Loading a byte in each mov instruction? Using some alternative instruction to mov for those addresses?
  2. Suppose that we have a large number of 4KiB virtual pages and want to improve TLB caching (page walk) of those addresses: how can we make it easy programmatically? 

Thank you

-Roberto

0 Kudos

Accepted Solutions
Highlighted
Moderator
87 Views

Re:hardware prefetching programmatically

Jump to solution

Hi Roberto,


Due to some error, your query has been marked spam. But you have already raised another thread. So we are closing this thread as this became a duplicate

of the new thread - https://community.intel.com/t5/Intel-C-Compiler/hardware-prefetching-programmatically-posted-again/m...


Regards

Prasanth


View solution in original post

0 Kudos
2 Replies
Highlighted
Moderator
88 Views

Re:hardware prefetching programmatically

Jump to solution

Hi Roberto,


Due to some error, your query has been marked spam. But you have already raised another thread. So we are closing this thread as this became a duplicate

of the new thread - https://community.intel.com/t5/Intel-C-Compiler/hardware-prefetching-programmatically-posted-again/m...


Regards

Prasanth


View solution in original post

0 Kudos
Highlighted
Novice
75 Views

Re: Re:hardware prefetching programmatically

Jump to solution

Yes please, thank you Prasanth!

-Roberto

0 Kudos