3 ms·
x86 does have a prefetch instruction, and it’s available as a compiler intrinsic in gcc and clang. But it’s really difficult to get a performance improvement fr
by fanf2 3y ago
x86 does have a prefetch instruction, and it’s available as a compiler intrinsic in gcc and clang. But it’s really difficult to get a performance improvement from explicit prefetching on modern big CPUs because their dynamic prefetchers are very clever. Your data access pattern needs to be something the prefetcher does not know how to match, and you need to be able to prefetch addresses before the speculator would get to them by itself. Unlikely for matrices unless they have a very weird shape.