When this operation is not available on the processor, it's still possible to proceed by successive passes, in this example on 32 bits: exchange two 16bit halfwords exchange bytes by pairs (0xddccbbaa -> 0xccddaabb) ... swap bits by pairs swap bits (b31 b30 ... b1 b0 -> b30 b31 ... b0 b1) The last operation can be written ((x&0x55555555)<<1) | (x&0xaaaaaaaa)>>1)).
Kada ova operacija nije dostupna na procesoru, i dalje je moguće da se ovo uradi sukcesivnim prolazom, na primer za 32 bita: exchange two 16bit halfwords exchange bytes by pairs (0xddccbbaa -> 0xccddaabb) ... swap bits by pairs swap bits (b31 b30 ... b1 b0 -> b30 b31 ... b0 b1) Poslednja operacija može biti zapisana na ovaj način :((x&0x55555555)<<1) | (x&0xaaaaaaaa)>>1)).