vcmpgtub
Vector Compare Greater Than Unsigned Byte
vcmpgtub vD, vA, vB
Unsigned > comparison for 16 bytes.
Details
Performs an unsigned greater-than comparison of two vector registers on a byte-by-byte basis (16 bytes) and stores a mask in the destination vector register, with all 1s where the comparison is true and all 0s where false. No CR or XER flags are modified by this instruction.
Pseudocode Operation
for i in 0 to 15 do
if vA[i] > vB[i] (unsigned) then
vD[i] ← 0xFF
else
vD[i] ← 0x00
Programming Note
vcmpgtub is useful for comparing unsigned byte values in vectors. Ensure both source vectors are properly aligned to avoid alignment faults. The instruction updates CR field 6 if Rc=1, indicating comparison results; check this for conditional logic. Performance may vary based on vector length and data distribution.
Example
vcmpgtub vd, va, vb
Encoding
Binary Layout
4
0
vD
6
vA
11
vB
16
518
21
Operands
-
vD
Target -
vA
Src A -
vB
Src B