问题
Is there an instruction using which I can move a variable to/from memory and registers without it being stored in cache? I don't want to disable caching entirely by using CD bit, I only want to do this for individual memory accesses.
回答1:
movnt
stores bypass cache, but movntdqa loads may not do that for normal (write-back) memory regions.
The instruction-set reference manual is very clear that it might not be any different from movdqa
on WB memory, but IDK what actually happens on any current microarchitectures.
movntdqa
is intended to speed up stuff like reading from WC video RAM, e.g. copying the results of a hardware video decoder back to main memory.
来源:https://stackoverflow.com/questions/37889896/intel-instructions-for-access-to-memory-which-skips-cache