xxsldwi

VSX Vector Shift Left Double by Word Immediate

xxsldwi XT,XA,XB,SHW

Shifts the contents of two vector registers left by a specified number of words and places the result into another vector register.

Details

The xxsldwi instruction shifts the contents of VSR[XA] and VSR[XB] left by SHW words and places the result into VSR[XT].

Pseudocode Operation

if MSR.VSX=0 then
    VSX_Unavailable()
source.qword[0] ←VSR[32×AX+A]
source.qword[1] ←VSR[32×BX+B]
VSR[32×TX+T] ←source.word[SHW:SHW+3]

Programming Note

The xxsldwi instruction is commonly used for shifting vector elements by a specified number of words. Ensure that the VSX (Vector Scalar Extensions) are enabled in the MSR register to avoid exceptions. The shift amount must be within the range of 0 to 3, as it specifies the word position to align the result. This instruction operates at the user privilege level and does not generate exceptions for valid shifts; however, misalignment or exceeding the shift limit can lead to undefined behavior.

Example

xxsldwi vs1, vs2, vs3, 0

Encoding

Binary Layout
18
0
SH[5:0]
6
VRT[4:0]
11
VRA[4:0]
16
VRB[4:0]
21
 
Format XX3-form
Opcode 0xF0000010
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target Vector Register
  • XA
    Source Vector Register
  • XB
    Source Vector Register
  • SHW
    Shift Amount in Words
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register
  • SH
    Shift Amount (Immediate)