Unpacking Packed 16-Bit Quantities To 32-Bit Values; Graphical Representation Of _Spack2 - Texas Instruments TMS320C6000 Programmer's Manual

Hide thumbs Also See for TMS320C6000:
Table of Contents

Advertisement

Packed-Data Processing on the 'C64x
Figure 8–4. Graphical Representation of _spack2
Table 8–4. Unpacking Packed 16-bit Quantities to 32-bit Values
Type
Position
Signed 16-bit
Upper half
Lower half
Unsigned 16-bit Upper half
Lower half
8-10
b
32 bits
Signed 32–bit
Signed
16–bit
hi
16 bits
Notice that there are no special unpack operations for 16-bit data. Instead, the
normal 32-bit right-shifts and extract operations can be used to unpack 16-bit
elements into 32-bit quantities. Table 8–4 describes how to unpack signed and
unsigned 16-bit quantities.
C code
dst = ((signed)src) >> 16;
dst = _ext(src, 16, 16);
dst = ((unsigned)src)>>16;
dst = _ext (src, 16, 16);
For 8-bit data, the 'C64x provides the _packX4, _spacku4, and _unpkX4 intrin-
sics for packing and unpacking data. The operation of these intrinsics is illus-
trated in Figure 8–5 and Figure 8–6. These intrinsics are geared around con-
verting between 8-bit and 16-bit packed data types. To convert between 32-bit
and 8-bit values, an intermediate step at 16-bit precision is required.
a
32 bits
Signed 32–bit
Signed
16–bit
lo
c = _spack2(b, a)
16 bits
Assembly code
SHR
EXT
SHRU src, 16, dst
EXTU src, 16,16, dst
Saturation step
Packing step
src, 16, dst
src, 16,16, dst

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C6000 and is the answer not in the manual?

Questions and answers

Table of Contents