Packed-Data Processing on the ’C64x
8-41
’C64x Programming Considerations
Figure 8–22. Graphical Illustration of _cmpXX4 Intrinsics
0 0 0 0 0 0 0 0 0 0 0
0
0
0
0 0 0 0 0
0
0
0
0 0 0 0 0 0
c
The _cmpXX4 operation
a_3
b_3
b_1
a
b
c = cmpXX4(a, b)
b_2
b_0
a_2
a_0
a_1
cmp
cmp
cmp
cmp
The expand intrinsics work from a bitfield such as the bitfield returned by the
compare intrinsics. The _xpnd2 and _xpnd4 intrinsics expand the lower 2 or
4 bits of a word to fill the entire 32-bit word of the result. The _xpnd2 intrinsic
expands the lower two bits of the input to two half–words, whereas _xpnd4 ex-
pands the lower four bits to four bytes. The expanded output is suitable for use
as a mask, for instance, for selecting values based on the result of a compari-
son. Figure 8–23 and Figure 8–24 illustrate.