15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

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.

Subword Permutation Instructions<br />

Initially, the rearrangement of subwords in registers manifested only as packing and unpacking operations.<br />

MAX-2 first introduced general-purpose subword permutation instructions for more versatile<br />

reordering of subwords packed into one or more registers.<br />

Pack Instructions<br />

Pack instructions convert from larger subwords to smaller subwords. If the value in the larger subword<br />

is greater than the maximum value that can be represented by the smaller subword, saturation arithmetic<br />

is performed, and the resulting subword is set to the maximum value of the smaller subword. Figure 39.28<br />

shows how a register with smaller packed subwords can be created from two registers with subwords that<br />

are twice as large. Pack instructions differ in the size of the supported subwords and in the saturation<br />

options used.<br />

Unpack Instructions<br />

Unpack instructions are used to convert smaller packed data types to larger ones. The subwords in the<br />

two source operands are written sequentially to the target register in alternating order. Because, only<br />

one-half of each of the source registers can be used, the unpack instructions come with two variants<br />

© 2002 by CRC Press LLC<br />

TABLE 39.5 Summary of packed shift and packed rotate Instructions<br />

Integer Operations IA-64 MAX-2 MMX SSE-2 3DNow! AltiVec<br />

ci = ai > b<br />

ci = ai >> bi ci = ai

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

Saved successfully!

Ooh no, something went wrong!