New blog post: "Bit-Twiddling: Optimising AArch64 Logical Immediate Encoding (and Decoding)"
Conversation
Replying to
Nice!
For the decoding lookup table equation, you could use 128b unsigned division with (2^128-1) / (2^2^(6-n) + 1) + 1, but that's a tad ridiculous...
Replying to
Thanks! Can't remember if I'd seen it for this specific case, but knowing that pattern in divisions it wasn't too hard to derive.
The +1 was on purpose though, or at least I thought so--I worked the formula out in Python, and tried it in C to make sure it would work...
1
Show replies

