Packed-Data Processing on the ’C64x
8-9
’C64x Programming Considerations
Figure 8–3. Graphical Representation of _packXX2 Intrinsics
b_hi
b_lo
a_hi
a_lo
b_lo
a_lo
c = _pack2(b, a)
b_hi
b_lo
b_hi
a_hi
a_hi
c=_packh2(b, a)
a_lo
b_lo
b_hi
a_hi
a_lo
b_hi
a_lo
c=_packhl2(b, a)
b_lo
a_hi
c=_packlh2(b, a)
b_hi
b_lo
a_hi
a_lo
b
a
c
b
a
c
b
a
c
b
a
c
The saturating pack intrinsic, _spack2, is closely related to the _pack2 intrin-
sic. The main difference is that the saturating pack first saturates the signed
32-bit source values to signed 16-bit quantities, and then packs these results
into a single 32-bit word. This makes it easier to support applications which
generate some intermediate 32-bit results, but need a signed 16-bit result at
the end. Figure 8–4 shows _spack2’s operation graphically.