Packed-Data Processing on the ’C64x
8-8
Table 8–3. Instructions for Manipulating Packed Data Types
Mnemonic
Intrinsic
Typical Uses With Packed Data
PACK2
PACKH2
PACKHL2
PACKLH2
_pack2
_packh2
_packhl2
_packlh2
Packing 16-bit portions of 32-bit quantities.
Rearranging packed 16-bit quantities.
Rearranging pairs of 16-bit quantities.
SPACK2
_spack2
Saturating 32-bit quantities down to signed 16-bit values, packing
them together.
SHR
SHRU
EXT
EXTU
(n/a)
(n/a)
_ext
_extu
Unpacking 16-bit values into 32-bit values
PACKH4
PACKL4
_packh4
_packl4
Unpacking 16-bit intermediate results into 8-bit final results.
De-interleaving packed 8-bit values.
UNPKHU4
UNPKLU4
_unpkhu4
_unpklu4
Unpacking unsigned 8-bit data into 16-bits.
Preparing 8-bit data to be interleaved.
SPACKU4
_spacku4
Saturating 16-bit quantities down to unsigned 8-bit values, packing
them together.
SHLMB
SHRMB
SWAP4
ROTL
_shlmb
_shrmb
_swap4
_rotl
Rearranging packed 8-bit quantities
The _packXX2 group of intrinsics work by extracting selected half-words from
two 32-bit registers, returning the results packed into a 32-bit word. This is pri-
marily useful for manipulating packed 16-bit data, although they may be used
for manipulating pairs of packed 8-bit quantites. Figure 8–3 illustrates the four
_packXX2() intrinsics, _pack2(), _packlh2(), _packhl2(), and _packh2(). (The
l and the h in the name refers to which half of each 32-bit input is being copied
to the output, similar to how the _mpyXX() intrisics are named.)