Passed Pawn actually seems like an ideal candidate for pdep. Pull all the bits where pawns could block. Ex: White has pawn on E4. Check for black pawns on D5, E5, F5, D6, E6 F6... etc. etc. A natural pdep (generate the D5, E5, F5... mask to AND with the opponent's pawn structure).At the moment I do a second calculation to get passed-pawn locations that I need to calculate their interactions with pieces
Hmmm... got it. I wish you luck with your method. It does seem like a good application of pext / pdep. You'll need to be careful about the ordering of bits for black vs white, bit-reverse probably would put things in the right order, but Intel x86 doesn't have a fast bit-reverse operator. (GPUs and ARM assembly has single-cycle bit-reverse, ironically)The idea is to do it in a way that looks a bit like what you are doing in convolutional nets, take an area of let's say 3 bits wide and 4 bits high, with 2 PEXT operations (one for each color) you get two 12 bit indices that you can translate into a single index into an array with pre-calculated or texel-tuned values, after this shift one column or row and repeat the procedure.