tags:

views:

270

answers:

1

Hello,

I am looking for an efficient algorithm in C to bitwise-transpose 8 bytes of data. What I mean with this is that if I have 8 bytes like this:

00011100
00111000
00000001
00000000
11000000
00000000
11111111
01010101

I want to get the following 8 bytes:

00001010
00001011
01000010
11000011
11000010
10000011
00000010
00100011

And since I want to use this on an embedded platform, it should be as fast as possible :-)

All ideas are much appreciated!

+11  A: 

See Hacker's Delight, Chapter 7-3.

kotlinski
Thanks. This is exactly what I was looking for!
Arnaud Gouder
@Arnaud, that is really cool... but what is an application that would require this function?
vicatcu