
Optimizing for SIMD Integer Applications
4
4-37
These transformations, in general, increase the number of instructions
required to perform the desired operation. For Pentium II, Pentium
III
,
and Pentium 4 processors, the benefit of avoiding forwarding problems
outweighs the performance penalty due to the increased number of
instructions, making the transformations worthwhile.
Supplemental Techniques for Avoiding Cache Line Splits
Some video processing applications sometimes cannot avoid loading
data from memory address that are aligned to 16 byte boundary. An
example of this situation is when each line in a video frame is averaged
by shifting horizontally half a pixel. Example 4-28 shows a common
operation in video processing that loads data from memory address not
aligned to 16 byte boundary. As video processing traverses each line in
the video frame, it will experience at least a cache line split for each
64 bytes loaded from memory.
Example 4-28 An Example of Video Processing with Cache Line Splits
// Average half-pels horizonally (on // the “x” axis),
// from one reference frame only.
nextLinesLoop:
movdqu xmm0, XMMWORD PTR [edx] // may not be 16B aligned
movdqu xmm0, XMMWORD PTR [edx+1]
movdqu xmm1, XMMWORD PTR [edx+eax]
movdqu xmm1, XMMWORD PTR [edx+eax+1]
pavgbxmm0, xmm1
pavgbxmm2, xmm3
movdqaXMMWORD PTR [ecx], xmm0
movdqaXMMWORD PTR [ecx+eax], xmm2
// (repeat ...)
Summary of Contents for ARCHITECTURE IA-32
Page 1: ...IA 32 Intel Architecture Optimization Reference Manual Order Number 248966 013US April 2006...
Page 220: ...IA 32 Intel Architecture Optimization 3 40...
Page 434: ...IA 32 Intel Architecture Optimization 9 20...
Page 514: ...IA 32 Intel Architecture Optimization B 60...
Page 536: ...IA 32 Intel Architecture Optimization C 22...