Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z

4-22 Vol. 2B
INSTRUCTION SET REFERENCE, N-Z
PABSB/PABSW/PABSD Packed Absolute Value
Description
PABSB/W/D computes the absolute value of each data element of the source operand
(the second operand) and stores the UNSIGNED results in the destination operand
(the first operand). PABSB operates on signed bytes, PABSW operates on 16-bit
words, and PABSD operates on signed 32-bit integers. The source operand can be an
MMX register or a 64-bit memory location, or it can be an XMM register or a 128-bit
memory location. The destination operand can be an MMX or an XMM register. Both
operands can be MMX register or XMM registers. When the source operand is a
128-bit memory operand, the operand must be aligned on a 16byte boundary or a
general-protection exception (#GP) will be generated.
In 64-bit mode, use the REX prefix to access additional registers.
Operation
PABSB with 64 bit operands
Unsigned DEST[7..0] <- ABS(SRC[7..0])
Repeat operation for 2nd through 7th bytes
Unsigned DEST[63..56] <- ABS(SRC[63..56])
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
0F 38 1C /r PABSB mm1,
mm2/m64
Valid Valid Compute the absolute value of
bytes in mm2/m64 and store
UNSIGNED result in mm1.
66 0F 38 1C
/r
PABSB xmm1,
xmm2/m128
Valid Valid Compute the absolute value of
bytes in xmm2/m128 and store
UNSIGNED result in xmm1.
0F 38 1D /r PABSW mm1,
mm2/m64
Valid Valid Compute the absolute value of 16-
bit integers in mm2/m64 and store
UNSIGNED result in mm1.
66 0F 38 1D
/r
PABSW xmm1,
xmm2/m128
Valid Valid Compute the absolute value of 16-
bit integers in xmm2/m128 and
store UNSIGNED result in xmm1.
0F 38 1E /r PABSD mm1,
mm2/m64
Valid Valid Compute the absolute value of 32-
bit integers in mm2/m64 and store
UNSIGNED result in mm1.
66 0F 38 1E
/r
PABSD xmm1,
xmm2/m128
Valid Valid Compute the absolute value of 32-
bit integers in xmm2/m128 and
store UNSIGNED result in xmm1.