vpermr

Vector Permute Right

vpermr vD, vA, vB, vC

Bitwise byte shuffle similar to vperm but for little-endian access optimization.

Details

The Vector Permute Right (vpermr) instruction performs a right permutation on the elements of a vector register.

Pseudocode Operation

// VMX vector operation -> v1

Programming Note

The vpermr instruction is used to perform a right permutation on the elements of a vector register. It is commonly used in scenarios where data needs to be shifted or rotated within a vector for operations like cryptography, signal processing, or custom algorithms. Ensure that the input vector is properly aligned and that the operation does not exceed the bounds of the vector register to avoid undefined behavior. This instruction operates at user privilege level and may raise exceptions if the alignment requirements are not met.

Example

vpermr vd, va, vb, vc

Encoding

Binary Layout
4
0
vD
6
vA
11
vB
16
vC
21
59
26
 
Format VA-form
Opcode 0x1000003B
Extension VMX (AltiVec)

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B
  • vC
    Permute
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register