vminub

Vector Minimum Unsigned Byte

vminub vD, vA, vB

Selects minimum value per byte (unsigned).

Details

The vminub instruction compares each byte of two vector registers and stores the minimum value in the corresponding byte of a third vector register. The comparison is performed using unsigned integer values.

Pseudocode Operation

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

   lt_flag ←EXTZ(src1) < EXTZ(src2)
   VSR[VRT+32].byte[i] ←lt_flag=1 ? src1 : src2
end

Programming Note

The vminub instruction is used to perform element-wise minimum comparison of unsigned bytes between two vector registers and store the results in a third register. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The operation is straightforward but requires both source vectors to be properly aligned for optimal performance.

Example

vminub vd, va, vb

Encoding

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

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B