xxswapd

VSX Vector Swap Doubleword

xxswapd XT, XA

Swaps the two doublewords in the register.

Encoding

Binary Layout
60
0:5
T
6:10
A
11:15
B
16:20
0
21
2
22:23
10
24:28
AX
29
BX
30
TX
31
 
Format XX3-form
Opcode 0xF0000250
Extension VSX

Operands

  • XT
    Target
  • XA
    Source

Example

xxswapd vs1, vs3

Registers Altered

MSR

Related

More in VSX

Reference

Description

Extended mnemonic of xxpermdi (Power ISA v3.1C, Book I, 7.6): xxswapd XT,XA is xxpermdi XT,XA,XA,2, so its word is xxpermdi's with DM set to 2. Swaps the two doublewords within the XA register and stores the result in XT. The high doubleword becomes the low doubleword and vice versa. This is a VSX instruction that does not affect condition or status flags.

Operation

XT[0:63] ← XA[64:127]
XT[64:127] ← XA[0:63]

Programming Note

xxswapd is xxpermdi with DM fixed at 2 and XA as both sources, so it puts the two doublewords of one register into XT in the other order. 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.