vsrv

Vector Shift Right Variable

vsrv vTMP1, vSRC, vSHCT1

Shifts each element of the source vector right by a variable amount specified in another vector.

Details

The vsrv instruction shifts each element of the source vector right by a variable amount specified in another vector. The result is stored in the destination vector.

Pseudocode Operation

for i from 0 to 15 do
    vTMP1[i] <- (vSRC[i]) >> (vSHCT1[i] & 0x7F)

Programming Note

The vsrv instruction shifts each element of the source vector right by a variable amount specified in another vector. Ensure that the shift amounts are within the range of 0 to 127 to avoid undefined behavior. This instruction operates at user privilege level and does not generate exceptions for normal operation.

Example

vsrv vtmp1, vsrc, vshct1

Encoding

Binary Layout
4
0
VRT
6
VRA
11
VRB
16
1796
21
 
Format X-form
Opcode 0x10000704
Extension VMX (AltiVec)

Operands

  • vTMP1
    Destination Vector Register
  • vSRC
    Source Vector Register
  • vSHCT1
    Shift Count Vector Register