2 ms·
It's worth noting that Daniel was testing scalar loads and stores up to 64-bits (8B). Unaligned loads for 16B and 32B vectors can have slightly more of a slowd
by nkurz 12y ago
It's worth noting that Daniel was testing scalar loads and stores up to 64-bits (8B). Unaligned loads for 16B and 32B vectors can have slightly more of a slowdown when they cross 64B cachelines. Unaligned stores across cachelines are somewhat worse, but usually not enough to really hurt you.
But note bene, unaligned vector stores that cross 4K pageline boundaries are so slow that they can destroy performance despite their rarity. Here's what the Intel Architecture Optimization Guide has to say:
11.6.3 Prefer Aligned Stores Over Aligned Loads
There are cases where it is possible to align only a subset
of the processed data buffers. In these cases,
aligning data buffers used for store operations usually
yields better performance than aligning data
buffers used for load operations.
Unaligned stores are likely to cause greater performance
degradation than unaligned loads, since there
is a very high penalty on stores to a split cache-line that
crosses pages. This penalty is estimated at 150
cycles. Loads that cross a page boundary are executed at
retirement. In Example 11-12, unaligned store
address can affect SAXPY performance for 3 unaligned
addresses to about one quarter of the aligned
case.
http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf http://www.intel.com/content/dam/www/public/us/en/documents/...