vmaxuw

Vector Maximum Unsigned Word

vmaxuw vD, vA, vB

Selects maximum value per word (unsigned).

Details

The vmaxuw instruction compares each unsigned word (32-bit) element in the vector registers specified by VRA and VRB. It selects the larger value for each corresponding pair of elements and stores the result in the vector register specified by VRT.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 3
   src1 ←VSR[VRA+32].word[i]
   src2 ←VSR[VRB+32].word[i]

gt_flag ←EXTZ(src1) > EXTZ(src2)
VSR[VRT+32].word[i] ←gt_flag=1 ? src1 : src2
end

Programming Note

The vmaxuw instruction is used to perform element-wise comparison of unsigned 32-bit words 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 operation does not require any specific alignment for the data being processed.

Example

vmaxuw vd, va, vb

Encoding

Binary Layout
4
0
vD
6
vA
11
vB
16
132
21
 
Format VA-form
Opcode 0x10000084
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B