3-555
INSTRUCTION SET REFERENCE
PSRAW/PSRADPacked Shift Right Arithmetic
Description
These instructions shift the bits in the data elements (words or doublewords) in the destination
operand (first operand) to the right by the amount of bits specified in the unsigned count operand
(second operand) (refer to Figure 3-78). The result of the shift operation is written to the desti-
nation operand. The empty high-order bits of each element are filled with the initial value of the
sign bit of the data element. If the value specified by the count operand is greater than 15 (for
words) or 31 (for doublewords), each destination data element is filled with the initial value of
the sign bit of the element.
The destination operand must be an MMX technology register; the count operand (source
operand) can be either an MMX technology register, a 64-bit memory location, or an 8-bit
immediate.
The PSRAW instruction shifts each of the four words in the destination operand to the right by
the number of bits specified in the count operand; the PSRAD instruction shifts each of the two
doublewords in the destination operand. As the individual data elements are shifted right, the
empty high-order bit positions are filled with the sign value.
Opcode
Instruction
Description
0F E1 /r
PSRAW mm,
mm/m64
Shift words in mm right by amount specified in mm/m64
while shifting in sign bits.
0F 71 /4 ib
PSRAW mm, imm8Shift words in mm right by imm8 while shifting in sign
bits
0F E2 /r
PSRAD mm,
mm/m64
Shift doublewords in mm right by amount specified in
mm/m64 while shifting in sign bits.
0F 72 /4 ib
PSRAD mm, imm8Shift doublewords in mm right by imm8 while shifting in
sign bits.
Figure 3-78. Operation of the PSRAW Instruction
PSRAW mm, 2
mm
mm
1111111111111100
1111111111111111
1101000111000111
1111010001110001
shift right
shift right
shift right
shift right
3006048