Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
Vol. 2B 4-85
INSTRUCTION SET REFERENCE, N-Z
PINSRW—Insert Word
Description
Copies a word from the source operand (second operand) and inserts it in the desti-
nation operand (first operand) at the location specified with the count operand (third
operand). (The other words in the destination register are left untouched.) The
source operand can be a general-purpose register or a 16-bit memory location.
(When the source operand is a general-purpose register, the low word of the register
is copied.) The destination operand can be an MMX technology register or an XMM
register. The count operand is an 8-bit immediate. When specifying a word location in
an MMX technology register, the 2 least-significant bits of the count operand specify
the location; for an XMM register, the 3 least-significant bits specify the location.
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
PINSRW instruction with 64-bit source operand:
SEL ← COUNT AND 3H;
CASE (Determine word position) OF
SEL ← 0: MASK ← 000000000000FFFFH;
SEL ← 1: MASK ← 00000000FFFF0000H;
SEL ← 2: MASK ← 0000FFFF00000000H;
SEL ← 3: MASK ← FFFF000000000000H;
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
0F C4 /r ib PINSRW mm,
r32/m16, imm8
Valid Valid Insert the low word from
r32 or from m16 into mm
at the word position
specified by imm8
REX.W + 0F C4 /r ib PINSRW mm,
r64/m16, imm8
Valid N.E. Insert the low word from
r64 or from m16 into mm
at the word position
specified by imm8
66 0F C4 /r ib PINSRW xmm,
r32/m16, imm8
Valid Valid Move the low word of r32
or from m16 into xmm at
the word position
specified by imm8.
REX.W + 66 0F C4 /r ib PINSRW xmm,
r64/m16, imm8
Valid N.E. Move the low word of r64
or from m16 into xmm at
the word position
specified by imm8.