Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
Vol. 2B 4-107
INSTRUCTION SET REFERENCE, N-Z
PMOVMSKB—Move Byte Mask
Description
Creates a mask made up of the most significant bit of each byte of the source
operand (second operand) and stores the result in the low byte or word of the desti-
nation operand (first operand). The source operand is an MMX technology register or
an XMM register; the destination operand is a general-purpose register. When oper-
ating on 64-bit operands, the byte mask is 8 bits; when operating on 128-bit oper-
ands, the byte mask is 16-bits.
In 64-bit mode, using a REX prefix in the form of REX.R permits this instruction to
access additional registers (XMM8-XMM15, R8-15). Use of REX.W permits the use of
64 bit general purpose registers.
Operation
PMOVMSKB instruction with 64-bit source operand and r32:
r32[0] ← SRC[7];
r32[1] ← SRC[15];
(* Repeat operation for bytes 2 through 6 *)
r32[7] ← SRC[63];
r32[31:8] ← ZERO_FILL;
PMOVMSKB instruction with 128-bit source operand and r32:
r32[0] ← SRC[7];
r32[1] ← SRC[15];
(* Repeat operation for bytes 2 through 14 *)
r32[15] ← SRC[127];
r32[31:16] ← ZERO_FILL;
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
0F D7 /r PMOVMSKB
r32, mm
Valid Valid Move a byte mask of mm
to r32.
REX.W + 0F D7 /r PMOVMSKB
r64, mm
Valid N.E. Move a byte mask of mm
to the lower 32-bits of r64
and zero-fill the upper
32-bits.
66 0F D7 /r PMOVMSKB
r32, xmm
Valid Valid Move a byte mask of xmm
to r32.
REX.W + 66 0F D7 /r PMOVMSKB
r64, xmm
Valid N.E. Move a byte mask of xmm
to the lower 32-bits of r64
and zero-fill the upper
32-bits.