lvsl

Load Vector for Shift Left Indexed

lvsl VRT,RA,RB

Loads a vector pattern suitable for shifting left indexed.

Details

Creates a shift-left permutation pattern based on the effective address (RA+RB) modulo 16 and loads it into VRT. This instruction is part of the VMX (AltiVec) category and is typically used to set up permutation vectors for unaligned vector loads. It does not update condition registers.

Pseudocode Operation

EA ← (RA = 0 ? 0 : GPR(RA)) + GPR(RB)
shift_amount ← EA[28:31]
VRT ← PermutationPattern(shift_amount, "shift_left")

Programming Note

The lvsl instruction can be used to create a permute control vector for vperm instructions. It is useful for loading and storing unaligned data, as well as rotating or shifting the contents of a VSR.

Example

lvsl v1, r4, r5

Encoding

Binary Layout
31
0
VRT
6
RA
11
RB
16
6
21
/
31
 
Format X-form
Opcode 0x7C00000C
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • VRT
    Target Vector Register
  • RA
    Source General Purpose Register
  • RB
    Source General Purpose Register