PMOVSX

Packed Move with Sign Extend

Opcodes

Hex Mnemonic Encoding Long Mode Legacy Mode Description
66 0f 38 25 /r PMOVSXDQ xmm1, xmm2/m64 A Valid Valid Sign extend 2 packed signed 32-bit integers in the low 8 bytes of xmm2/m64 to 2 packed signed 64-bit integers in xmm1.
66 0f 38 24 /r PMOVSXWQ xmm1, xmm2/m32 A Valid Valid Sign extend 2 packed signed 16-bit integers in the low 4 bytes of xmm2/m32 to 2 packed signed 64-bit integers in xmm1.
66 0f 38 23 /r PMOVSXWD xmm1, xmm2/m64 A Valid Valid Sign extend 4 packed signed 16-bit integers in the low 8 bytes of xmm2/m64 to 4 packed signed 32-bit integers in xmm1.
66 0f 38 22 /r PMOVSXBQ xmm1, xmm2/m16 A Valid Valid Sign extend 2 packed signed 8-bit integers in the low 2 bytes of xmm2/m16 to 2 packed signed 64-bit integers in xmm1.
66 0f 38 21 /r PMOVSXBD xmm1, xmm2/m32 A Valid Valid Sign extend 4 packed signed 8-bit integers in the low 4 bytes of xmm2/m32 to 4 packed signed 32-bit integers in xmm1.
66 0f 38 20 /r PMOVSXBW xmm1, xmm2/m64 A Valid Valid Sign extend 8 packed signed 8-bit integers in the low 8 bytes of xmm2/m64 to 8 packed signed 16-bit integers in xmm1.

Instruction Operand Encoding

Op/En Operand 0 Operand 1 Operand 2 Operand 3
A NA NA ModRM:r/m (r) ModRM:reg (w)

Description

Sign-extend the low byte/word/dword values in each word/dword/qword element of the source operand (second operand) to word/dword/qword integers and stored as packed data in the destination operand (first operand).

Pseudo Code

PMOVSXBW DEST[15:0] = SignExtend(SRC[7:0]);
DEST[31:16] = SignExtend(SRC[15:8]);
DEST[47:32] = SignExtend(SRC[23:16]);
DEST[63:48] = SignExtend(SRC[31:24]);
DEST[79:64] = SignExtend(SRC[39:32]);
DEST[95:80] = SignExtend(SRC[47:40]);
DEST[111:96] = SignExtend(SRC[55:48]);
DEST[127:112] = SignExtend(SRC[63:56]);
PMOVSXBD DEST[31:0] = SignExtend(SRC[7:0]);
DEST[63:32] = SignExtend(SRC[15:8]);
DEST[95:64] = SignExtend(SRC[23:16]);
DEST[127:96] = SignExtend(SRC[31:24]);
PMOVSXBQ DEST[63:0] = SignExtend(SRC[7:0]);
DEST[127:64] = SignExtend(SRC[15:8]);
PMOVSXWD DEST[31:0] = SignExtend(SRC[15:0]);
DEST[63:32] = SignExtend(SRC[31:16]);
DEST[95:64] = SignExtend(SRC[47:32]);
DEST[127:96] = SignExtend(SRC[63:48]);
PMOVSXWQ DEST[63:0] = SignExtend(SRC[15:0]);
DEST[127:64] = SignExtend(SRC[31:16]);
PMOVSXDQ DEST[63:0] = SignExtend(SRC[31:0]);
DEST[127:64] = SignExtend(SRC[63:32]);

Flags Affected

None

Exceptions

64-Bit Mode Exceptions

Exception Description
#AC(0) If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.
#UD If EM in CR0 is set. If OSFXSR in CR4 is 0. If CPUID feature flag ECX.SSE4_1 is 0. If LOCK prefix is used. Either the prefix REP (F3h) or REPN (F2H) is used.
#NM If TS in CR0 is set.
#PF(fault-code) For a page fault.
#SS(0) If a memory address referencing the SS segment is in a non- canonical form.
#GP(0) If the memory address is in a non-canonical form.

Compatibility Mode Exceptions

Same exceptions as in Protected Mode.

Virtual-8086 Mode Exceptions

Exception Description
#AC(0) If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.
#PF(fault-code) For a page fault.
Same exceptions as in Real Address Mode.

Real-Address Mode Exceptions

Exception Description
#UD If CR0.EM[bit 2] = 1. If CR4.OSFXSR[bit 9] = 0. If CPUID.01H:ECX.SSE4_1[bit 19] = 0. If LOCK prefix is used. Either the prefix REP (F3h) or REPN (F2H) is used.
#NM If CR0.TS[bit 3] = 1.
#GP if any part of the operand lies outside of the effective address space from 0 to 0FFFFH.

Protected Mode Exceptions

Exception Description
#AC(0) If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.
#UD If CR0.EM[bit 2] = 1. If CR4.OSFXSR[bit 9] = 0. If CPUID.01H:ECX.SSE4_1[bit 19] = 0. If LOCK prefix is used. Either the prefix REP (F3h) or REPN (F2H) is used.
#NM If CR0.TS[bit 3] = 1.
#PF(fault-code) For a page fault.
#SS(0) For an illegal address in the SS segment.
#GP(0) For an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments.