vrld

Vector Rotate Left Doubleword

vrld vD, vA, vB

Rotates each doubleword left.

Details

The Vector Rotate Left Doubleword instruction (vrld) rotates each doubleword element in the source vector VRA left by a number of bits specified by the corresponding doubleword element in the source vector VRB. The result is stored in the destination vector VRT.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 1
   src ←VSR[VRA+32].dword[i]
   shVSR[VRB+32].dword[i].bit[58:63]
   VSR[VRT+32].dword[i] ←src <<< sh
end

Programming Note

The vrld instruction is commonly used for bit manipulation tasks that require rotating doublewords within a vector. Ensure that the source vectors are properly aligned to avoid unexpected behavior. This instruction operates at user privilege level and will raise an exception if the VEC bit in the MSR register is not set.

Example

vrld vd, va, vb

Encoding

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

Operands

  • vD
    Target
  • vA
    Data
  • vB
    Rotate Count