vsubudm

Vector Subtract Unsigned Doubleword Modulo

vsubudm vD, vA, vB

Subtracts the contents of two vector registers and places the result in a third vector register, modulo operation.

Details

The Vector Subtract Unsigned Doubleword Modulo instruction subtracts each unsigned doubleword element from the corresponding element in another vector, modulo 2^64. The result is placed into a destination vector.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 1
   src1 ←EXTZ(VSR[VRA+32].dword[i])
   src2 ←EXTZ(VSR[VRB+32].dword[i])
   VSR[VRT+32].dword[i] ←CHOP64(src1 + ¬src2 + 1)
end

Programming Note

This instruction is used for performing unsigned doubleword subtraction with modulo arithmetic. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The operation is performed on each pair of elements from two source vectors, and the results are stored in the destination vector. Be cautious with alignment as it may affect performance or cause exceptions if not properly managed.

Example

vsubudm vd, va, vb

Encoding

Binary Layout
000100
0
vD
6
vA
11
vB
16
10011
21
000000
26
 
Format VX-form
Opcode 0x100004C0
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register