An approach to precomputed move generation bitboards
Posted: Tue Dec 01, 2015 2:58 am
Using the following data setup ...
... it would work like this. Using a board of piece indexes a stack of bitboards for moves and one for captures can be accessed using the stack pointer 'i'. The bitboards for each piece are precomputed and placed in their stack. Whenever a piece is moved that bit is zeroed, the stack pointer is incremented and its bitboards are generated. Pieces that are affected also haft to have this done. A bit_list of affected pieces can be maintained so this work can be done when needed avoiding unnecessary work at the leaves.
I'm curious if this approach is different than other precomputed move ideas. And what is thought about its efficiency. Also do my data structures look correct for an SMP implementation? Thanks
Code: Select all
#define s32 signed __int32
#define u64 unsigned __int64
typedef struct {
s32 type;
s32 i;
u64 moves [200];
u64 capts [200];
} piece_s;
typedef struct {
s32 wtm;
s32 board[64];
piece_s piece[33];
history_s history[400];
} thread_s;
s32 iBoard[64] = {13, 9,11,15,16,12,10,14,
1, 2, 3, 4, 5, 6, 7, 8,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
17,18,19,20,21,22,23,24,
29,25,27,31,32,28,26,30};
I'm curious if this approach is different than other precomputed move ideas. And what is thought about its efficiency. Also do my data structures look correct for an SMP implementation? Thanks