vmsumubm

Vector Multiply-Sum Unsigned Byte Modulo

vmsumubm vD, vA, vB, vC

Multiplies bytes and sums adjacent results into words.

Details

The vmsumubm instruction performs a vector multiply-sum operation on unsigned bytes. It multiplies each byte of the first source vector by the corresponding byte of the second source vector, adds the result to the corresponding word element of the third source vector, and stores the low-order 16 bits of the sum in the destination vector.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 7
   src1 ←EXTZ(VSR[VRA+32].byte[i])
   src2 ←EXTZ(VSR[VRB+32].byte[i])
   src3 ←VSR[VRC+32].word[i/4]

   VSR[VRT+32].word[i/4] ←CHOP16((src1 × src2) + src3)
end

Programming Note

This instruction is commonly used for performing efficient vectorized operations on unsigned byte data. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The operation processes 8 bytes per iteration, multiplying corresponding elements and adding to the third source vector's word element, storing the result in the destination vector. Be cautious of overflow as only the low-order 16 bits are stored.

Example

vmsumubm vd, va, vb, vc

Encoding

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

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B
  • vC
    Accumulator