Figure 1. swaph
Description
Swaps the contents of register rA treated as two halfwords, and places the result in rD. This effectively converts the two halfwords in the register between endianness formats, either from little-endian to big-endian or vice versa.
Pseudocode
(rD)[0:15] ← (rA)[16:31]
(rD)[16:31] ← (rA)[0:15]
Registers Altered
- rD
Latency
- 1 cycle
Note
- This instruction is only valid if MicroBlaze
is configured to use reorder instructions (
C_USE_REORDER_INSTR
= 1).