14 Jan
2014
14 Jan
'14
4:34 p.m.
I don't know if this is the fastest but, ... On 2014-01-14 16:26, Tom Rokicki wrote:
For an unsigned 64-bit integer, define br(x) to be the "bit reversal" of x: bit positions 0 and 63 are swapped, 1 and 62 are swapped, and so on.
What's the fastest way in generic C code to compute
br(a) < br(b)
[Don't spoil this if you've seen it already, please.]
-tom
. . . . . . . . . !!((a-b)&(b-a)&b)