vrldmi

Vector Rotate Left Doubleword then Mask Insert

vrldmi VRT,VRA,VRB

Rotates the contents of a vector register left by a specified number of bits and inserts the result into another vector register under control of a mask.

Details

The vrldmi instruction rotates each doubleword element of VSR[VRA+32] left by a number of bits specified in VSR[VRB+32].bit[58:63], generates a mask from bits 41:47 and 49:55 of VSR[VRB+32], and inserts the rotated data into VSR[VRT+32] under control of this mask.

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
do i = 0 to 1
    src1.dword[0] ←VSR[VRA+32].dword[i]
    src1.dword[1] ←VSR[VRA+32].dword[i]
    src2 ←VSR[VRB+32].dword[i]
    src3 ←VSR[VRT+32].dword[i]
    b ←src2.bit[42:47]
    e ←src2.bit[50:55]
    n ←src2.bit[58:63]
    r ←src1.bit[n:n+63]
    m ←MASK(b, e)
    VSR[VRT+32].dword[i] ←(r & m) | (src3 & ¬m)

Programming Note

The vrldmi instruction is used for rotating doubleword elements and performing masked insertions. Ensure that the Vector Facility is enabled by checking and setting the VEC bit in the MSR register. Be cautious with the alignment of source and target vectors to avoid unexpected results. This operation requires supervisor privilege level.

Example

vrldmi v1, v2, v3

Encoding

Binary Layout
00011
0
SH[5:0]
6
VX[4:0]
11
VY[4:0]
16
VB[4:0]
 
Format VX-form
Opcode 0x100000C5
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register
  • VX
    Target Vector Register
  • VY
    Source Vector Register
  • VB
    Mask Vector Register
  • SH
    Shift Amount