As I travel about 2000 miles by car, I have some time for ideas. Here is one;
Reduce the size of attacks bitmaps to 16 bits using the PEXT command and a PDEP command. this will make an 800+ KB table about 1/4th the size.
So you first use pext to extract the bits to make an index into the attacks bitmap table. But instead of the table having 64 bit values, it has 16 bit values. You then use pdep to deposit the bits back into the 64 bit result using th e same map. So this should be much more cache friendly, and maybe faster if pdep is fast.
I will try it late tonight when I reach a hotel. If anyone beats me to it, let me know if it is faster.mark
BMI2 PEXT idea for attacks generation
Moderators: hgm, Rebel, chrisw
-
- Posts: 2250
- Joined: Wed Mar 08, 2006 8:47 pm
- Location: Hattingen, Germany
Re: BMI2 PEXT idea for attacks generation
Hi Mark
you mean PEXT/PDEP Bitboards?
Zach already had the idea back in 2011.
http://www.talkchess.com/forum/viewtopic.php?t=40333
Cheers,
Gerd
you mean PEXT/PDEP Bitboards?
Zach already had the idea back in 2011.
http://www.talkchess.com/forum/viewtopic.php?t=40333
Cheers,
Gerd
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: BMI2 PEXT idea for attacks generation
And I verified recently that it is faster on my Kabylake laptop:
http://talkchess.com/forum/viewtopic.ph ... 441#727441
While we're at it, note that SF's current variable-shift magics implementation is considerably slower than a clever fixed-shift solution.
http://talkchess.com/forum/viewtopic.ph ... 441#727441
While we're at it, note that SF's current variable-shift magics implementation is considerably slower than a clever fixed-shift solution.