3 ms·
I want to use them for speeding up some critical code for compression/decompresison, the current code is not straightforward. How to implement the instructions
by gorset 15y ago
I want to use them for speeding up some critical code for compression/decompresison, the current code is not straightforward.
How to implement the instructions in software is covered in Hacker's delight, and has some additions in the latest revisions (http://www.hackersdelight.org/revisions.pdf http://www.hackersdelight.org/revisions.pdf).
There's also a chapter in Matters Computational (http://www.jjj.de/fxt/#fxtbook http://www.jjj.de/fxt/#fxtbook) "CPU instructions often missed" that mentions them:
> Primitives for permutations of bits, see section 1.29.2 on page 81. A bit-gather and a bit-scatter instruction for sub-words of all sizes a power of 2 would allow for arbitrary permutations (see [FXT: bits/bitgather.h] and [FXT: bits/bitseparate.h] for versions working on complete words).