03.03.2013 Views

Intel® Architecture Instruction Set Extensions Programming Reference

Intel® Architecture Instruction Set Extensions Programming Reference

Intel® Architecture Instruction Set Extensions Programming Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INSTRUCTION SET REFERENCE - VEX-ENCODED GPR INSTRUCTIONS<br />

PEXT — Parallel Bits Extract<br />

Opcode/<strong>Instruction</strong> Op/<br />

En<br />

Description<br />

<strong>Instruction</strong> Operand Encoding<br />

PEXT uses a mask in the second source operand (the third operand) to transfer either contiguous or non-contiguous<br />

bits in the first source operand (the second operand) to contiguous low order bit positions in the destination<br />

(the first operand). For each bit set in the MASK, PEXT extracts the corresponding bits from the first source operand<br />

and writes them into contiguous lower bits of destination operand. The remaining upper bits of destination are<br />

zeroed.<br />

Figure 7-2. PEXT Example<br />

This instruction is not supported in real mode and virtual-8086 mode. The operand size is always 32 bits if not in<br />

64-bit mode. In 64-bit mode operand size 64 requires VEX.W1. VEX.W1 is ignored in non-64-bit modes. An<br />

attempt to execute this instruction with VEX.L not equal to 0 will cause #UD.<br />

Operation<br />

TEMP ← SRC1;<br />

MASK ← SRC2;<br />

DEST ← 0 ;<br />

m← 0, k← 0;<br />

DO WHILE m< OperandSize<br />

IF MASK[ m] = 1 THEN<br />

DEST[ k] ← TEMP[ m];<br />

k ← k+ 1;<br />

64/32<br />

-bit<br />

Mode<br />

CPUID<br />

Feature<br />

Flag<br />

Description<br />

VEX.NDS.LZ.F3.0F38.W0 F5 /r A V/V BMI2 Parallel extract of bits from r32b using mask in r/m32, result is written<br />

to r32a.<br />

PEXT r32a, r32b, r/m32<br />

VEX.NDS.LZ.F3.0F38.W1 F5 /r A V/N.E. BMI2 Parallel extract of bits from r64b using mask in r/m64, result is written<br />

to r64a.<br />

PEXT r64a, r64b, r/m64<br />

Op/En Operand 1 Operand 2 Operand 3 Operand 4<br />

A ModRM:reg (w) VEX.vvvv (r) ModRM:r/m (r) NA<br />

SRC1<br />

SRC2<br />

(mask)<br />

DEST<br />

S31 S30 S29 S28 S27 S7 S6 S5 S4 S3 S2 S1 S0 0<br />

0<br />

bit 31<br />

0<br />

0<br />

0<br />

0<br />

1<br />

0<br />

0<br />

0<br />

7-16 Ref. # 319433-014<br />

1<br />

0<br />

0<br />

0<br />

1<br />

0<br />

0<br />

0<br />

0<br />

1<br />

S28 S7 0<br />

S 5<br />

0<br />

S 2<br />

bit 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!