vcmpgtub

Vector Compare Greater Than Unsigned Byte

vcmpgtub vD, vA, vB

Unsigned > comparison for 16 bytes.

Encoding

Binary Layout
4
0:5
vD
6:10
vA
11:15
vB
16:20
518
21:31
 
Format VC-form
Opcode 0x10000206
Extension VMX (AltiVec)

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B

Example

vcmpgtub vd, va, vb

Registers Altered

MSR, CR6

Related

More in VMX (AltiVec)

Reference

Description

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.

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.