xxpermdi
VSX Permute Doubleword Immediate
Selects two doublewords from the four available in source registers XA and XB based on a 2-bit selector.
Details
The xxpermdi instruction permutes the doublewords of VSR[XA] and VSR[XB] into VSR[XT] based on the immediate value DM. If DM.bit[1]=0, the contents of doubleword element 0 of VSR[XB] are placed into doubleword element 1 of VSR[XT]. Otherwise, the contents of doubleword element 1 of VSR[XB] are placed into doubleword element 1 of VSR[XT].
Pseudocode Operation
Programming Note
The xxpermdi instruction is used to permute doublewords from two VSX registers into a third register based on an immediate value. Ensure that the VSX facility is enabled in the MSR register; otherwise, a VSX_Unavailable exception will be raised. The immediate value DM controls which doubleword elements are selected from VSR[XB] for placement in VSR[XT].
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
| xxspltd | |
| xxmrghd | |
| xxmrgld | |
| xxswapd |
Example
Encoding
Operands
-
XT
Target -
XA
Source A -
XB
Source B -
DM
Selector (2 bits)