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<br />

Description<br />

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

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

A ModRM:reg (r, w) ModRM:r/m (r) NA NA<br />

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

Performs a SIMD compare for equality of the packed bytes, words, doublewords, or quadwords in the first source<br />

operand and the second source operand. If a pair of data elements is equal the corresponding data element in the<br />

destination operand is set to all 1s, otherwise it is set to all 0s.<br />

The (V)PCMPEQB instruction compares the corresponding bytes in the destination and source operands; the<br />

(V)PCMPEQW instruction compares the corresponding words in the destination and source operands; the<br />

(V)PCMPEQD instruction compares the corresponding doublewords in the destination and source operands, and the<br />

(V)PCMPEQQ instruction compares the corresponding quadwords in the destination and source operands.<br />

Legacy SSE instructions: The second source operand can be an XMM register or a 128-bit memory location. The<br />

first source and destination operands are XMM registers. In 64-bit mode using a REX prefix in the form of REX.R<br />

permits this instruction to access additional registers (XMM8-XMM15).<br />

128-bit Legacy SSE version: The second source operand can be an XMM register or a 128-bit memory location. The<br />

first source and destination operands are XMM registers. Bits (255:128) of the corresponding YMM destination<br />

register remain unchanged.<br />

VEX.128 encoded version: The second source operand can be an XMM register or a 128-bit memory location. The<br />

first source and destination operands are XMM registers. Bits (255:128) of the corresponding YMM register are<br />

zeroed.<br />

VEX.256 encoded version: The first source operand is a YMM register. The second source operand is a YMM register<br />

or a 256-bit memory location. The destination operand is a YMM register.<br />

Operation<br />

COMPARE_BYTES_EQUAL (SRC1, SRC2)<br />

IF SRC1[7:0] = SRC2[7:0]<br />

THEN DEST[7:0] FFH;<br />

ELSE DEST[7:0] 0; FI;<br />

(* Continue comparison of 2nd through 15th bytes in SRC1 and SRC2 *)<br />

IF SRC1[127:120] = SRC2[127:120]<br />

THEN DEST[127:120] FFH;<br />

ELSE DEST[127:120] 0; FI;<br />

COMPARE_WORDS_EQUAL (SRC1, SRC2)<br />

IF SRC1[15:0] = SRC2[15:0]<br />

THEN DEST[15:0] FFFFH;<br />

ELSE DEST[15:0] 0; FI;<br />

(* Continue comparison of 2nd through 7th 16-bit words in SRC1 and SRC2 *)<br />

IF SRC1[127:112] = SRC2[127:112]<br />

THEN DEST[127:112] FFFFH;<br />

ELSE DEST[127:112] 0; FI;<br />

COMPARE_DWORDS_EQUAL (SRC1, SRC2)<br />

IF SRC1[31:0] = SRC2[31:0]<br />

THEN DEST[31:0] FFFFFFFFH;<br />

ELSE DEST[31:0] 0; FI;<br />

(* Continue comparison of 2nd through 3rd 32-bit dwords in SRC1 and SRC2 *)<br />

IF SRC1[127:96] = SRC2[127:96]<br />

THEN DEST[127:96] FFFFFFFFH;<br />

ELSE DEST[127:96] 0; FI;<br />

5-50 Ref. # 319433-014

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

Saved successfully!

Ooh no, something went wrong!