Chapter 2. Programming Model
2-75
AltiVec UISA Instructions
2.5.1.2 Vector Integer Compare Instructions
The vector integer compare instructions algebraically or logically compare the contents of
the elements in vector register
v
A with the contents of the elements in
v
B. Each compare
result vector is comprised of TRUE (0xFF, 0xFFFF, 0xFFFF_FFFF) or FALSE (0x00,
0x0000, 0x0000_0000) elements of the size speciTed by the compare source operand
element (byte, half word, word, or quad word). The result vector can be directed to any VR
and can be manipulated with any of the instructions as normal data (for example,
combining condition results).
Vector compares provide equal-to and greater-than predicates. Others are synthesized from
these by logically combining and/or inverting result vectors.
The integer compare instructions (shown in Table 2-60) can optionally set the CR6 Teld of
the PowerPC condition register. If Rc = 1 in the vector integer compare instruction, then
CR6 is set to reect the result of the comparison, as follows in Table 2-59.
Table 2-60 summarizes the vector integer compare instructions.
Vector Minimum Unsigned Integer
vminub
vminuh
vminuw
v
D
,v
A
,v
B
Vector Minimum Signed Integer
vminsb
vminsh
vminsw
v
D
,v
A
,v
B
Table 2-59. CR6 Field Bit Settings for Vector Integer Compare Instructions
CR Bit
CR6 Bit
Vector Compare
24
0
1 Relation is true for all element pairs
(that is,
v
D is set to all ones)
25
1
0
26
2
1 Relation is false for all element pairs (that is, register
v
D is cleared)
27
3
0
Table 2-60. Vector Integer Compare Instructions
Name
Mnemonic
Syntax
Vector Compare Greater than Unsigned
Integer
vcmpgtub[.]
vcmpgtuh[.]
vcmpgtuw[.]
CR06,v
D
,v
A
,v
B
Vector Compare Greater than Signed Integer
vcmpgtsb[.]
vcmpgtsh[.]
vcmpgtsw[.]
CR06,v
D
,v
A
,v
B
Vector Compare Equal to Unsigned Integer
vcmpequb[.]
vcmpequh[.]
vcmpequw[.]
v
D
,v
A
,v
B
Table 2-58. Vector Integer Arithmetic Instructions (Continued)
Name
Mnemonic
Syntax