Ask HN: Favourite Assembly Instructions?
One for the low-level gurus among you: what is/are your favourite assembly-language instructions, accross the ages & instruction sets?
To get this started: for the good 'ol Z80, I'm torn between Decrement-and-Jump-if-Not-Zero (DJNZ), and Decimal Adjust Accumulator (DAA). Rarely used ComPare, Increment & Repeat (CPIR) could be another contender.
On RISC-V, I much like the Set-Less-Than (SLT..) instructions. Great for replacing conditional branches with branchless, sequential math.
Your favourites?
4 comments
[ 1.7 ms ] story [ 16.1 ms ] threadBut my favorite is the 8x8 bit matrix transpose SIMD instruction (gf2p8affine, which does a bit more, buy I care about the tranapose). Combined with SIMD byte permutes it allows you to do things like: arbitrarily permute bits in SIMD elements, find the invers of a permutation, very fast histograming/binning
Because it has a utility named after it. Hence my name.