Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |
| en:multiasm:papc:chapter_6_15 [2026/02/20 11:41] – [Cache support instructions] ktokarz | en:multiasm:papc:chapter_6_15 [2026/02/20 11:49] (current) – [Cache temporal locality] ktokarz |
|---|
| * Object-oriented programming helps to utilise cache because members of the class are grouped. | * Object-oriented programming helps to utilise cache because members of the class are grouped. |
| ===== Cache temporal locality ===== | ===== Cache temporal locality ===== |
| This feature helps improve performance in situations where the program uses the same variables repeatedly, e.g. in a loop. | Cache temporal locality is the feature that helps improve performance in situations where the program uses the same variables repeatedly, e.g. in a loop. If the processed data exceeds half the size of a level 1 cache, it is recommended to use the non-temporal data move instructions **movntq** and **movntdq** to store data from registers to memory. These instructions are hints to the processor to omit the cache if possible. It doesn't mean that the data is immediately stored directly in memory. It can remain in the internal processor's buffers, and, likely, the last version is not visible to other units of the computer. It is the programmer's responsibility to synchronise the data using the **sfence** (Store Fence) instruction. |
| In a situation where the data processed exceeds half the size of a level 1 cache, it is recommended to use the non-temporal data move instructions **movntq** and **movntdq** to store data from registers to memory. These instructions are hints to the processor to omit the cache if possible. It doesn't mean that the data is immediately stored directly in memory. It can remain in the internal processor's buffers, and it is likely that the last version is not visible to other units of the computer. It is the programmer's responsibility to synchronise the data using the **sfence** (Store Fence) instruction. | |
| |
| ===== Cache support instructions ===== | ===== Cache support instructions ===== |