silc_prefetch

NAME

    static inline void silc_prefetch(void *addr, int rw, int locality);

DESCRIPTION

Simple prefetch. Loads memory from specified address to CPU cache. The amount of data loaded is CPU dependant (cache line length). The `rw' argument defines the reason for prefetch: 0=read, 1=write. The `locality' argument defines the locality of the prefetch, 0=non-temporal (non-temporal cache, cache closest to CPU, data will not stay long in the cache), 1=temporal (L2+ cache), 2=temporal (L2, L3+ cache), 3=temporal (fetch to all caches, data stays longer time in cache).

NOTES

This produces only a hint for CPU. CPU doesn't have to actually prefetch the data. Use silc_prefetch_block to ensure CPU always prefetches.