Before I forget about it: The usual technique is - swapping pairs of single bits - swapping pairs of two bits - swapping pairs of four bits etc. til end. For words of length 3, one just has to swap the first and last bit. For words of length 3, one can do as just said for the length-3 sub-words then swap the first and last runs of 3 bits. Etc., 3^k bits reversed in k steps! Naively doing this with words of length not of the form 3^k leads to deletion of initial ones, BAD! Now one has to truncate masks to avoid losing ones. When you look into it, there is a truly huge amount of possible ways to do the task. Here is a way of reversing words of 2^k-1 bits: 1 bit: nop 3 bits: swap first and last 7 bits: as before for first and last 3 bits (one bits stays in the middle), then swap first and runs of 3 bits. 2^(k+1)-1 bits: as 2^k-1 for the first and last 2^k-1 bits, (one bits stays in the middle), then swap first and runs of 2^k-1 bits. Doing better is (for me, so far) a matter of creativity, the neat routine I gave for 64 bits uses the fact that 64 - 1 is divisible by 9. Here is a strategy for a (slightly different) routine, just as fine as the one I have given: Split the 63 low bits as [27][9][27] <--= [b] means "run of b bits" now use the 3^k idea to reverse all runs of 9 bits (two steps). At the next step, the two runs of 27 are completed (the middle run has to be left alone). At the last step, swap the two 27-bit runs. Done in four steps, or five for 64 bits with just an additional rotation by one. I didn't manage to find anything for 32 bits (neither 31 bits) better than this. I offer 100 Euro for a routine for 32 bits (or 31, your choice) that uses one op less than my routine for 64 (or 63 when you pick 31 above). Best, jj