5 ms·
There are some neat tricks there about interleaving bits from two operands. But what about from 3?
by mungoman2 10y ago
There are some neat tricks there about interleaving bits from two operands. But what about from 3?
- emanuelev 10y agoIf you are referring to Morton's interleaving, then it's quite simple. You can compute the third operand's code and OR it with the others using the appropriate shift. Something like: (z << 2) | (y << 1) | x
- Kristine1975 10y agoMaybe this helps: http://www.forceflow.be/2013/10/07/morton-encodingdecoding-through-bit-interleaving-implementations/ http://www.forceflow.be/2013/10/07/morton-encodingdecoding-t...