Routable by the inverse Butterfly network.
Best method found: Bit group moving (about 10 cycles on superscalar processors):
x = ((x & 0x0000004e) << 1) | ((x & 0x80000000) >> 21) | ((x & 0x00000020) >> 5) | ((x & 0x00004010) >> 3) | ((x & 0x00000400) >> 2);
See documentation to
pext and pdep can be emulated with compress_right and expand_right.
This result is not necessarily the best possible, but at least several methods have been challenged.
See also some notes on the inner workings.
There is an even better calculator calcperm.* which is usable for various word sizes (Pascal and C++ sources).
Error reports, comments or questions? E-mail: firstname.lastname@example.org