vrlq

Vector Rotate Left Quadword

vrlq vD, vA, vB

Rotates the contents of a vector register left by a specified number of bits.

Details

Rotates the 128-bit contents of the source vector left by the number of bits specified in the shift-count register and stores the result in the destination vector. The rotate amount is taken modulo 128; bits shifted out the left end wrap around to the right. No condition flags are affected; this is a VMX/AltiVec instruction.

Pseudocode Operation

shiftAmount ← vB[121:127] mod 128
vD[0:127] ← (vA[0:127] << shiftAmount) | (vA[0:127] >> (128 - shiftAmount))

Programming Note

The vrlq instruction is used to perform a left rotation of 128 bits in a vector register. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The shift amount is determined by the upper 7 bits of another vector register, so ensure these bits are set correctly to avoid unexpected results.

Example

vrlq vd, va, vb

Encoding

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

Operands

  • vD
    Target
  • vA
    Data
  • vB
    Shift
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register