In the context of the Intel® 64 and IA-32 Architectures Software Developer Manuals, what exactly is a processor "hint?"
I see it in a few sections:
In the description of
PREFETCHWT1
-Prefetch hint T1 with intent to write.In the SSE4 introduction "The technology also provides a hint that can improve memory throughput when reading from uncacheable WC memory type." Which led to me to this answer regarding WC memory but no clear description of what a hint is.
Next I read one of the SSE4 instructions can perform a load with a "streaming" hint. This led me to the SSE4 Programming reference where I discovered hints can be temporal or non-temporal.
The streaming load hint instruction itself
MOVNTDQA
"provides a non-temporal hint"Further into the manual, I find Transactional Synchronization Extensions(TSX) use a "prefix hint" in
XACQUIRE
andXRELEASE
In the AVX 512 bit section when describing
VGATHERPF0DPD
and others (there are 7 more of these types of instructions all with the /PS option). In these situations we have either a T0 or T1 hint using dword or qword indices.The most insightful time I saw hint used in the manual (this list is in order) came in section 10.4.6.1 where it reads
"The non-temporal hint directs the processor to store the data to memory without writing the data into the cache hierarchy."
This is in the 'Cacheability Control Instructions' section involving MOVNTQ
, MOVNTPS
, MASKMOVQ
so would a temporal hint write to a cache line? I'm inferring this as if it's the opposite of a non-temporal hint?
Other links I used in an attempt to piece together the meaning of processor hints:
The Wikipedia page on cache lines ...says hints can prepare, discard, or evict cache lines (also called buffers?). So are hints just instructions that relate to cache lines?
Thank you
MOVNTDQA
is the same asMOVDQA
except it tells the processor that you will not reuse the value. That is the "non temporal hint". The cpu can then avoid loading the data into the cache. (But you have found that out already.) There were also branch prediction hints that would tell the cpu whether the jump is expected to be taken or not. – SandersonMOVNTDQA
itself is not a hint. It has a proper function: it does the data transfer. The hint just provides extra information about how you intend to use the data.XACQUIRE/XRELEASE
are hints, they are prefixes applied to some other instruction. Also hints don't need to deal with cache.XACQUIRE
does not deal with cache. Branch hints don't deal with cache. Hints are whatever general information you can pass to the cpu so it can do its job better. It should still be able to perform the same job without the hints but maybe slower. – Sanderson