Zach Wegner wrote:The instructions, particularly the bit manipulation instructions, look pretty awesome for chess. Check out PEXT/PDEP: instead of magic bitboards, you can just get the attack mask, extract out the relevant bits with PEXT, do a table lookup of a 2-byte value (just a compressed attack bitboard), and use PDEP to decompress back to an attack bitboard. Too bad there's not a vector version too :)
Excellent. I've been waiting for those two instructions for many years.
Always seemed like an "obvious" way to do it.
You can save a little memory on the 2-byte tables too. For example,
the rook tables for h1 and a8 would be identical. Doesn't seem to work
for many tables though.