25.02.2015 Views

AMD 64-Bit Technology - ECE User Home Pages

AMD 64-Bit Technology - ECE User Home Pages

AMD 64-Bit Technology - ECE User Home Pages

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>AMD</strong> <strong>64</strong>-<strong>Bit</strong> <strong>Technology</strong> 26568—Rev. 3.02—August 2002<br />

PMADDWD<br />

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 128-bit memory location.<br />

Mnemonic Opcode Description<br />

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

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

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

the destination XMM register.<br />

xmm1<br />

xmm2/mem128<br />

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

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

.<br />

. . .<br />

.<br />

. . .<br />

multiply<br />

multiply<br />

multiply<br />

multiply<br />

add<br />

add<br />

.<br />

.<br />

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

0<br />

pmaddwd-128.eps<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 />

252 PMADDWD

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

Saved successfully!

Ooh no, something went wrong!