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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INSTRUCTION SET REFERENCE<br />

Description<br />

Performs a SIMD signed compare for the greater value of the packed byte, word, doubleword, or quadword integers<br />

in the first source operand and the second source operand. If a data element in the first source operand is greater<br />

than the corresponding date element in the second source operand the corresponding data element in the destination<br />

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

The (V)PCMPGTB instruction compares the corresponding signed byte integers in the first and second source operands;<br />

the (V)PCMPGTW instruction compares the corresponding signed word integers in the first and second source<br />

operands; the (V)PCMPGTD instruction compares the corresponding signed doubleword integers in the first and<br />

second source operands, and the (V)PCMPGTQ instruction compares the corresponding signed qword integers in<br />

the first and second source operands.<br />

Legacy SSE instructions: In 64-bit mode using a REX prefix in the form of REX.R permits this instruction to access<br />

additional registers (XMM8-XMM15). The second source operand can be an XMM register or a 128-bit memory location.<br />

The first source operand and destination operand are XMM registers.<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 operand and destination operand 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 operand and destination operand are XMM registers. Bits (255:128) of the corresponding YMM register<br />

are 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_GREATER (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_GREATER (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_GREATER (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 />

COMPARE_QWORDS_GREATER (SRC1, SRC2)<br />

IF SRC1[63:0] > SRC2[63:0]<br />

THEN DEST[63:0] FFFFFFFFFFFFFFFFH;<br />

5-54 Ref. # 319433-014

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

Saved successfully!

Ooh no, something went wrong!