vcmpgtuh
Vector Compare Greater Than Unsigned Halfword
Unsigned > comparison for 8 halfwords.
Details
Performs an unsigned greater-than comparison of two vector registers on a halfword-by-halfword basis (8 halfwords) 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 7 do
if vA[i] > vB[i] (unsigned) then
vD[i] ← 0xFFFF
else
vD[i] ← 0x0000
Programming Note
The vcmpgtuh instruction is commonly used for comparing unsigned halfword elements in vector registers. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The instruction updates the CR field if Rc=1, which can be useful for conditional branching based on the comparison results.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B