On 20/04/2014 15:38, Joerg Arndt wrote:
* Gareth McCaughan <gareth.mccaughan@pobox.com> [Apr 20. 2014 16:25]: ...
(Perhaps it might, for FFT-related reasons. But if no major CPU architecture has ever had a bit-reversal operation -- is that true? -- then it seems pretty likely that at least once someone's given careful thought to whether it would be worth including and decided not.)
I do not know how many gates it takes for revbin, but speculate it would be very cheap (certainly cheaper than shift/rotate by [arg] positions), as you'd need just N/2 "swap bit pair" mechanisms (where N = word length).
The scarce resource is not gates, nor even "wiring space" on the chip. It's space in the instruction set: whatever opcodes you dedicate to bit-reversal (or maybe, ARM-like, to making bit-reversal an option in other instructions) are not available for (1) other things that might offer more performance benefits in real code or (2) future expansion.
There is another _very_ good reason for revbin: quite a few tricks in use the fact that the adder propagates "instantaneously" through arbitrarily man positions. I'll show a very neat trick in another message that works in _one_ direction.
Is that "very good, for people who love neat hacks" or "very good, in actual performance improvement in databases and web browsers and first-person shooter games and nuclear bomb simulations and other things that people with money to spend on their computers care about?"? (For the avoidance of doubt, I personally derive much more pleasure from a neat bit-twiddling hack than from seeing someone's database run 0.1% faster. But I, and others like me, don't account for a large fraction of Intel's -- or ARM's, AMD's, etc. -- revenues.) -- g