To add context to these answers:
When you do a memory copy, the processor will typically do a read from the source (RS), then do a read from the destination (RD), and finally, when the cacheline is flushed, a write to the destination (WD).
By using the non-temporal intrinsic, you are providing a hint that the RD may not need to occur, and possibly that the cacheline should be prioritized for eviction. Intel's own documentation doesn't mention the need to do fencing [https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#ig_expand=0,6555,6556&text=movnt], so this probably isn't something that you would need to worry about.
Intel's guidance on non temporal code suggests it may impact performance in unexpected ways, for instance:
/**
* @brief GCM-AES Encryption using 128 bit keys, Non-temporal data
*
* Non-temporal version of encrypt has additional restrictions:
* - The plaintext and cyphertext buffers must be aligned on a 64 byte boundary.
* - In-place encryption/decryption is not recommended. Performance can be slow.
*
* @requires SSE4.1 and AESNI
*/
[https://github.com/intel/isa-l_crypto/blob/master/include/aes_gcm.h]
As a rule of thumb, you probably shouldn't use the non-temporal version of the MOV instructions unless you need it (i.e. avoid premature optimization). An easy way to visualize if optimizations are needed are tools like Intel Performance Monitor Counter [https://www.intel.com/content/www/us/en/developer/articles/tool/performance-counter-monitor.html]. This tool can show you your actual bandwidth to/from memory and if your expected usage doesn't match your actual usage the NT instructions might be a good fix.
Lastly, if you are in a position to only target newer Intel processors, just use AVX512, which reads and writes one cacheline at at a time. This avoids any chance of an extra RD without causing a potentially incorrect hint.
MOVNTDQA xmmi, m128
is an NT load, while all the other NT instructions are stores, except forprefetchnta
. The accepted answer here only seems to be talking about stores. This is what I've been able to turn up about NT loads. TL:DR: hopefully the CPU does something useful with the NT hint to minimize cache pollution, but they don't override the strongly-ordered semantics of "normal" WB memory, so they do have to use the cache.