PSUBSB
PSUBSxx, PSUBUSx: Subtract Packed Integers With Saturation
PSUBSB mm1,mm2/m64 ; 0F E8 /r [PENT,MMX]
PSUBSW mm1,mm2/m64 ; 0F E9 /r [PENT,MMX]
PSUBSB xmm1,xmm2/m128 ; 66 0F E8 /r [WILLAMETTE,SSE2]
PSUBSW xmm1,xmm2/m128 ; 66 0F E9 /r [WILLAMETTE,SSE2]
PSUBUSB mm1,mm2/m64 ; 0F D8 /r [PENT,MMX]
PSUBUSW mm1,mm2/m64 ; 0F D9 /r [PENT,MMX]
PSUBUSB xmm1,xmm2/m128 ; 66 0F D8 /r [WILLAMETTE,SSE2]
PSUBUSW xmm1,xmm2/m128 ; 66 0F D9 /r [WILLAMETTE,SSE2]
PSUBSx and PSUBUSx subtracts packed integers in the source operand from those in the destination operand, and use saturation for results that are outide the range supported by the destination operand.
PSUBSB operates on signed bytes, and uses signed saturation on the results.
PSUBSW operates on signed words, and uses signed saturation on the results.
PSUBUSB operates on unsigned bytes, and uses signed saturation on the results.
PSUBUSW operates on unsigned words, and uses signed saturation on the results.
PSUBB
PSUBx: Subtract Packed Integers
PSUBB mm1,mm2/m64 ; 0F F8 /r [PENT,MMX]
PSUBW mm1,mm2/m64 ; 0F F9 /r [PENT,MMX]
PSUBD mm1,mm2/m64 ; 0F FA /r [PENT,MMX]
PSUBQ mm1,mm2/m64 ; 0F FB /r [WILLAMETTE,SSE2]
PSUBB xmm1,xmm2/m128 ; 66 0F F8 /r [WILLAMETTE,SSE2]
PSUBW xmm1,xmm2/m128 ; 66 0F F9 /r [WILLAMETTE,SSE2]
PSUBD xmm1,xmm2/m128 ; 66 0F FA /r [WILLAMETTE,SSE2]
PSUBQ xmm1,xmm2/m128 ; 66 0F FB /r [WILLAMETTE,SSE2]
PSUBx subtracts packed integers in the source operand from those in the destination operand. It doesn't differentiate between signed and unsigned integers, and doesn't set any of the flags.
PSUBB operates on byte sized elements.
PSUBW operates on word sized elements.
PSUBD operates on doubleword sized elements.
PSUBQ operates on quadword sized elements.
PSRLx
Usage: PSRLx dest,count Modifies flags: None
Shifts the bits in the individual data elements (words, doublewords, or quadword) in the 'dest' to the right by the number of bits specified in the 'count' operand.
Shift Packed Data Right Logical
PSRLW mm,mm/64 ;0F D1 /r [Pent4]
PSRLW xmm1,xmm2/mem128 ;66 0F D1 /r [Pent4]
PSRLW mm,imm8 ;0F 71 /2 ib [Pent4]
PSRLW xmm1,imm8 ;66 0F 71 /2 ib [Pent4]
PSRLD mm,mm/mem64 ;0F D2 /r [Pent4]
PSRLD xmm1,xmm2/mem128 ;66 0F D2 /r [Pent4]
PSRLD mm,imm8 ;0F 72 /2 ib [Pent4]
PSRLD xmm1,imm8 ;66 0F 72 /2 ib [Pent4]
PSRLQ mm,mm/mem64 ;0F D3 /r [Pent4]
PSRLQ xmm1,xmm2/mem128 ;66 0F D3 /r [Pent4]
PSRLQ mm,imm8 ;0F 73 /2 ib [Pent4]
PSRLQ xmm1,imm8 ;66 0F 73 /2 ib [Pent4]
As the bits in the data elements are shifted right, the empty high-order bits are cleared (set to 0). If the value specified by the count operand is greater than 15 (for words), 31 (for doublewords), or 63 (for a quadword), then the 'dest' operand is set to all 0s.
The destination operand may be an MMX technology register or an XMM register; the count operand can be either an MMX technology register or an 64-bit memory location, an XMM register or a 128-bit memory location,or an 8-bit immediate.
PSRLW Shift packed words right logical
PSRLD Shift packed doublewords right logical
PSRLQ Shift packed quadword right logical
EXAMPLE:
mov ax 60 | psrlq xmm1 ax | mov ax 25 | psrld xmm2 ax | mov ax 8 | psrlw xmm3 ax
PSRLDQ
Usage: PSRLDQ dest,count Modifies flags: None
Shift xmm1 'dest' register left by 'count' bytes while shifting in 0s.
Shift Double Quadword Right Logical
PSRLDQ xmm1,imm8 ; 66 0F 73 / 3 ib [Pent4]
Shifts the destination operand (first operand) to the right by the number of bytes specified in the count operand (second operand). The empty high-order bytes are cleared (set to all 0s).
If the value specified by the count operand is greater than 15, the 'dest' operand is set to all 0s.
The destination operand is an XMM register. The 'count' operand is an 8-bit immediate.
EXAMPLE:
psrldq xmm1 8
PSRAx
Usage: PSRAx dest,count Modifies flags: None
Shifts the bits in the individual data elements (words or doublewords) in the 'dest' operand to the right by the number of bits specified in the 'count' operand.
Packed Data Bit Shift Right Arithmetic
PSRAW mm1,mm2/m64 ; 0F E1 /r [PENT,MMX]
PSRAW mm,imm8 ; 0F 71 /4 ib [PENT,MMX]
PSRAW xmm1,xmm2/m128 ; 66 0F E1 /r [WILLAMETTE,SSE2]
PSRAW xmm,imm8 ; 66 0F 71 /4 ib [WILLAMETTE,SSE2]
PSRAD mm1,mm2/m64 ; 0F E2 /r [PENT,MMX]
PSRAD mm,imm8 ; 0F 72 /4 ib [PENT,MMX]
PSRAD xmm1,xmm2/m128 ; 66 0F E2 /r [WILLAMETTE,SSE2]
PSRAD xmm,imm8 ; 66 0F 72 /4 ib [WILLAMETTE,SSE2]
PSRAx performs arithmetic right shifts of the data elements in the destination (first) operand, moving each bit in the separate elements right by the number of bits specified in the source (second) operand, setting the high-order bits to the value of the original sign bit.
As the bits in the data elements are shifted right, the empty high-order bits 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 'dest' data element is filled with the initial value of the sign bit of the element.
The destination operand may be an MMX technology register or an XMM register; the count operand can be either an MMX technology register or an 64-bit memory location, an XMM register or a 128-bit memory location, or an 8-bit immediate.
PSRAW shifts word sized elements. PSRAD shifts doubleword sized elements.
EXAMPLE:
mov ax 14 | psrad xmm1 ax | mov ax 25 | psraw xmm2 ax
PSLLx
Usage: PSLLx dest,count Modifies flags: None
Shifts the bits in the individual data elements (words, doublewords, or quadword) in the 'dest' operand to the left by the number of bits specified in the 'count' operand.
Shift Packed Data Left Logical
PSLLW mm,mm/mem64 ; 0F F1 /r [Pent4]
PSLLW xmm1,xmm2/mem128 ; 66 0F F1 /r [Pent4]
PSLLW mm,imm8 ; 0F 71 /6 ib [Pent4]
PSLLW xmm1,imm8 ; 66 0F 71 /6 ib [Pent4]
PSLLD mm,mm/mem64 ; 0F F2 /r [Pent4]
PSLLD xmm1,xmm2/mem128 ; 66 0F F2 /r [Pent4]
PSLLD mm,imm8 ; 0F 72 /6 ib [Pent4].
PSLLD xmm1,imm8 ; 66 0F 72 /6 ib [Pent4]
PSLLQ mm,mm/mem64 ; 0F F3 /r [Pent4]
PSLLQ xmm1,xmm2/mem128 ; 66 0F F3 /r [Pent4]
PSLLQ mm,imm8 ; 0F 73 /6 ib [Pent4]
PSLLQ xmm1,imm8 ; 66 0F 73 /6 ib [Pent4]
As the bits in the data elements are shifted left, the empty low-order bits are cleared (set to 0). If the value specified by the count operand is greater than 15 (for words), 31 (for doublewords), or 63 (for a quadword), then the 'dest' operand is set to all 0s.
The 'dest' operand may be an MMX technology register or an XMM register; the 'count' operand can be either an MMX technology register or 64-bit memory location, an XMM register or a 128-bit memory location, or an 8-bit immediate.
PSLLW Shift packed words left logical
PSLLD Shift packed doublewords left logical
PSLLQ Shift packed quadword left logical
EXAMPLE:
psllw xmm1 3 | pslld xmm2 32 |psllq xmm3 53
PSLLDQ
Usage: PSLLDQ dest,count Modifies flags: None
Shift xmm1 'dest' register left by 'count' bytes while shifting in 0s.
Shift Double Quadword Left Logical
PSLLDQ xmm1,imm8 ; 66 0F 73 / 7 ib [Pent4]
Shifts the 'dest' (first operand) to the left by the number of bytes specified in the 'count' (second operand).
The empty low-order bytes are cleared (set to all 0s). If the value specified by the count operand is greater than 15, the 'dest' operand is set to all 0s. The 'dest' operand is an XMM register. The 'count' operand is an 8-bit immediate.
EXAMPLE:
pslldq xmm1 4
PSHUFW
Usage: PSHUFW dest,src,order Modifies flags: None
Copies words from the 'src' operand and inserts them in the 'dest' operand at word locations selected with the 'order' operand (third operand).
Shuffle Packed Words
PSHUFW mm1,mm2/m64,imm8 ; 0F 70 /r ib [KATMAI,MMX]
PSHUFW shuffles the words in the source (second) operand according to the encoding specified by imm8, and stores the result in the destination (first) operand.
Bits 0 and 1 of imm8 encode the source position of the word to be copied to position 0 in the destination operand. Bits 2 and 3 encode for position 1, bits 4 and 5 encode for position 2, and bits 6 and 7 encode for position 3. For example, an encoding of 10 in bits 0 and 1 of imm8 indicates that the word at bits 32-47 of the source operand will be copied to bits 0-15 of the destination.
EXAMPLE:
pshufw xmm1 Label 2
PSHUFLW
Usage: PSHUFLW dest,src,order Modifies flags: None
Copies words from the low quadword of the 'src' and inserts them in the low quadword of the 'dest' at word locations selected with the 'order' operand.
Shuffle Packed Low Words
PSHUFLW xmm1,xmm2/m128,imm8 ; F2 0F 70 /r ib [WILLAMETTE,SSE2]
PSHUFLW shuffles the words in the low quadword of the source (second) operand according to the encoding specified by imm8, and stores the result in the low quadword of the destination (first) operand.
The operation of this instruction is similar to the PSHUFW instruction, except that the source and destination are the low quadword of a 128-bit operand, instead of being 64-bit operands. The high quadword is copied from the source to the destination without any changes.
This operation is similar to the operation used by the PSHUFD instruction. For the PSHUFLW instruction, each 2- bit field in the order operand selects the contents of one word location in the low quadword of the 'dest operand. The binary encodings of the 'order' operand fields select words (0, 1, 2, or 3) from the low quadword of the 'src operand to be copied to the 'dest' operand. The high quadword of the 'src' operand is copied to the high quadword of the 'dest' operand.
EXAMPLE:
pshuflw xmm1 Label 2
PSHUFHW
Usage: PSHUFHW dest,src,order Modifies flags: None
Copies words from the high quadword of the 'src' (second operand) and inserts them in the high quadword of the 'dest' (first operand) at word locations selected with the 'order' operand (third operand).
Shuffle Packed High Words
PSHUFHW xmm1,xmm2/m128,imm8 ; F3 0F 70 /r ib [WILLAMETTE,SSE2]
PSHUFW shuffles the words in the high quadword of the source (second) operand according to the encoding specified by imm8, and stores the result in the high quadword of the destination (first) operand.
The operation of this instruction is similar to the PSHUFW instruction, except that the source and destination are the top quadword of a 128-bit operand, instead of being 64-bit operands. The low quadword is copied from the source to the destination without any changes. This operation is similar to the operation used by the PSHUFD instruction.
EXAMPLE:
pshufhw xmm1 Label 2