开发者

prefetch to a specific level of cache

开发者 https://www.devze.com 2023-02-02 12:17 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消