Cool Chess Engine Bit Twiddling Trick

While having a go at writing my own chess engine I came across a ridiculously beautiful bit twiddling trick…