SIMD/Uses/SAD: Difference between revisions

→‎Code example: involved data types
(→‎Code example: involved data types)
Line 75: Line 75:


By design of the SSE2 SAD instruction, the register represented by "a" now contains two sums -- for each 64-bit halve of the 128-bit register one SAD. The following instructions ensure that these two SAD components are added. The last step is to convert the content of the 128-bit SSE2 register to a 32-bit integer.
By design of the SSE2 SAD instruction, the register represented by "a" now contains two sums -- for each 64-bit halve of the 128-bit register one SAD. The following instructions ensure that these two SAD components are added. The last step is to convert the content of the 128-bit SSE2 register to a 32-bit integer.
=== Involved data types ===
In this example the SAD for vectors of pixel values is computed. Each pixel is represented as a 8-bit unsigned integer. The type of the input vectors can thus be described as uint8x16. The output of the whole procedure can have the uint32 type.
51

edits