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.

PHADDW/PHADDD — Packed Horizontal Add<br />

Opcode/<br />

<strong>Instruction</strong><br />

Description<br />

Op/<br />

En<br />

64/32<br />

-bit<br />

Mode<br />

CPUID<br />

Feature<br />

Flag<br />

Description<br />

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

INSTRUCTION SET REFERENCE<br />

66 0F 38 01 /r A V/V SSSE3 Add 16-bit signed integers horizontally, pack to xmm1.<br />

PHADDW xmm1, xmm2/m128<br />

66 0F 38 02 /r A V/V SSSE3 Add 32-bit signed integers horizontally, pack to xmm1.<br />

PHADDD xmm1, xmm2/m128<br />

VEX.NDS.128.66.0F38.WIG 01 /r B V/V AVX Add 16-bit signed integers horizontally, pack to xmm1.<br />

VPHADDW xmm1, xmm2,<br />

xmm3/m128<br />

VEX.NDS.128.66.0F38.WIG 02 /r B V/V AVX Add 32-bit signed integers horizontally, pack to xmm1.<br />

VPHADDD xmm1, xmm2,<br />

xmm3/m128<br />

VEX.NDS.256.66.0F38.WIG 01 /r B V/V AVX2 Add 16-bit signed integers horizontally, pack to ymm1.<br />

VPHADDW ymm1, ymm2,<br />

ymm3/m256<br />

VEX.NDS.256.66.0F38.WIG 02 /r B V/V AVX2 Add 32-bit signed integers horizontally, pack to ymm1.<br />

VPHADDD ymm1, ymm2,<br />

ymm3/m256<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 />

(V)PHADDW adds two adjacent 16-bit signed integers horizontally from the second source operand and the first<br />

source operand and packs the 16-bit signed results to the destination operand. (V)PHADDD adds two adjacent 32bit<br />

signed integers horizontally from the second source operand and the first source operand and packs the 32-bit<br />

signed results to the destination operand. The first source and destination operands are XMM registers. The second<br />

source operand is an XMM register or a 128-bit memory location.<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 use the REX prefix to access additional<br />

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 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: Horizontal addition of two adjacent data elements of the low 16-bytes of the first and<br />

second source operands are packed into the low 16-bytes of the destination operand. Horizontal addition of two<br />

adjacent data elements of the high 16-bytes of the first and second source operands are packed into the high 16bytes<br />

of the destination operand. The second source operand can be an YMM register or a 256-bit memory location.<br />

The first source and destination operands are YMM registers.<br />

Ref. # 319433-014 5-57

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

Saved successfully!

Ooh no, something went wrong!