Using the BMI2 instruction set to encode / decode Morton Codes
I’ve updated my Libmorton library to use BMI2 CPU instructions if they are available. You can read more about Morton codes, their uses and the library in the previous blogposts about the subject. As a quick recap, the problem is that you easily want to interleave bits from a set of coordinates …