vnegd

Vector Negate Doubleword

vnegd vD, vB

Negates each doubleword integer.

Details

The vnegd instruction negates each doubleword element in the source vector and places the result into the destination vector. It performs a one's complement operation on each doubleword element followed by adding 1.

Pseudocode Operation

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

Programming Note

The vnegd instruction is used to negate each doubleword element in a vector. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. This operation is performed on 64-bit elements, so ensure proper alignment and size of the vectors involved.

Example

vnegd vd, vb

Encoding

Binary Layout
4
0
vD
6
0
11
vB
16
1604
21
 
Format VX-form
Opcode 0x10000644
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vB
    Source