xxswapd

VSX Vector Swap Doubleword

xxswapd XT, XB

Swaps the two doublewords in the register.

Details

The xxswapd instruction swaps the doubleword elements of two VSX registers. If DM.bit[0]=0, it places the contents of doubleword element 0 of VSR[XA] into doubleword element 1 of VSR[XT]. Otherwise, it places the contents of doubleword element 1 of VSR[XA] into doubleword element 1 of VSR[XT].

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
VSR[32×TX+T].dword[0] ←VSR[32×AX+A].dword[DM.bit[0]]
VSR[32×TX+T].dword[1] ←VSR[32×AX+A].dword[DM.bit[1]]

Programming Note

The xxswapd instruction swaps doubleword elements between two VSX registers based on the DM bit setting. Ensure that the VSX facility is enabled in the MSR register to avoid a VSX_Unavailable exception. This instruction operates at user privilege level and does not require specific alignment of data.

Example

xxswapd vs1, vs3

Encoding

Binary Layout
60
0
XT
6
0
11
XB
16
250
21
 
Format XX2-form
Opcode 0xF00000FA
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target
  • XB
    Source