Packed Average (Byte/Word); Figure 4-9 Psadbw Instruction Example - Intel ARCHITECTURE IA-32 Reference Manual

Architecture optimization
Table of Contents

Advertisement

Figure 4-9 PSADBW Instruction Example

The subtraction operation presented above is an absolute difference, that
is,
t = abs(x-y
values are summed together, and the result is written into the lower
word of the destination register.

Packed Average (Byte/Word)

The
pavgb
source operand to the unsigned data elements of the destination register,
along with a carry-in. The results of the addition are then each
independently shifted to the right by one bit position. The high order
bits of each element are filled with the carry bits of the corresponding
sum.
The destination operand is an SIMD register. The source operand can
either be an SIMD register or a memory operand.
63
X8
X7
X6
-
-
-
63
Y8
Y7
Y6
=
=
=
63
T8
T7
T6
63
0..0
0..0
0..0
). The byte values are stored in temporary space, all
and
instructions add the unsigned data elements of the
pavgw
Optimizing for SIMD Integer Applications
M M/m 64
X5
X4
X3
X2
X1
-
-
-
-
-
MM
Y5
Y4
Y3
Y2
Y1
=
=
=
=
=
Tem p
T5
T4
T3
T2
T1
MM
T1+T2+T3+T4+T5+T6+T7+T8
OM15167
4
0
0
0
0
4-31

Advertisement

Table of Contents
loading

Table of Contents