09.01.2013 Views

AMD x86-64 Architecture Programmer's Manual, Volume 4, 128-Bit ...

AMD x86-64 Architecture Programmer's Manual, Volume 4, 128-Bit ...

AMD x86-64 Architecture Programmer's Manual, Volume 4, 128-Bit ...

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.

26568—Rev. 3.05—September 2003 <strong>AMD</strong><strong>64</strong> Technology<br />

PMADDWD Packed Multiply Words and Add Doublewords<br />

Multiplies each packed 16-bit signed value in the first source operand by the<br />

corresponding packed 16-bit signed value in the second source operand, adds the<br />

adjacent intermediate 32-bit results of each multiplication (for example, the<br />

multiplication results for the adjacent bit fields 63–48 and 47–32, and 31–16 and<br />

15–0), and writes the 32-bit result of each addition in the corresponding doubleword of<br />

the destination (first source). The first source/destination operand is an XMM register<br />

and the second source operand is another XMM register or <strong>128</strong>-bit memory location.<br />

Mnemonic Opcode Description<br />

PMADDWD xmm1, xmm2/mem<strong>128</strong> 66 0F F5 /r Multiplies eight packed 16-bit signed values in an XMM<br />

register and another XMM register or <strong>128</strong>-bit memory<br />

location, adds intermediate results, and writes the result in<br />

the destination XMM register.<br />

.<br />

xmm1 xmm2/mem<strong>128</strong><br />

127 112 111 96 95 80 79 <strong>64</strong> 63 48 47 32<br />

31 16 15 0<br />

. . .<br />

multiply<br />

add<br />

multiply<br />

.<br />

multiply<br />

multiply<br />

There is only one case in which the result of the multiplication and addition will not fit<br />

in a signed 32-bit destination. If all four of the 16-bit source operands used to produce<br />

a 32-bit multiply-add result have the value 8000h, the 32-bit result is 8000_0000h,<br />

which is incorrect.<br />

.<br />

.<br />

add<br />

127 96 95 <strong>64</strong> 63 32 31<br />

0<br />

127 112 111 96 95 80 79 <strong>64</strong> 63 48 47 32 31 16 15 0<br />

. . .<br />

pmaddwd-<strong>128</strong>.eps<br />

PMADDWD 253

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

Saved successfully!

Ooh no, something went wrong!