GCC has __builtin_prefetch
to support prefetching. My question is how can I prefetch the data to a specific level of cache. For exa开发者_Go百科mple, I only would like to prefetch the data to L2 cache
instead of all the way to L1 cache
.
__builtin_prefetch has three arguments; the third one is the cache level. AFAICT, this has only effect on SSE, where it generates prefetchnta, prefetcht1, prefetcht2, prefetcht3, respectively.
精彩评论