vrlqnm

Vector Rotate Left Quadword then AND with Mask VX-form

vrlqnm VRT,VRA,VRB

Rotates the contents of a vector register left by a specified number of bits and performs a bitwise AND operation with a mask derived from another vector register.

Details

Rotates the quadword element in VRA left by a number of bits specified in VRB, then performs a bitwise AND with a mask derived from the lower bits of VRB to produce the result in VRT. No condition flags are affected.

Pseudocode Operation

shamt ← (VRB[120:127]) & 0x7F
mask_bits ← (VRB[120:127]) & 0x3F
rotated ← (VRA << shamt) | (VRA >> (128 - shamt))
mask ← Generate_Mask(mask_bits)
VRT ← rotated & mask

Programming Note

The vrlqnm instruction is used for vectorized operations involving rotation and masking of quadword data. Ensure that the Vector Facility (VEC) bit in the Machine State Register (MSR) is set to 1, otherwise a Vector_Unavailable exception will be raised. The mask generation from bits 41:47 and 49:55 of VSR[VRB+32] should be carefully managed to achieve the desired bitwise AND operation result.

Example

vrlqnm v1, v2, v3

Encoding

Binary Layout
4
0
VRT
6
VRA
11
VRB
16
 
Format VX-form
Opcode 0x10000145
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register