Bitboard question
Posted: 14 Mar 2006, 13:02
Hi all,
I am once again experimenting with bitboards. I have made numerous private rotated bitboard versions of Glaurung over the last year, but they were always slower and less compact than my mailbox versions (even on the 64-bit G5 CPU). The reason is almost certainly that I haven't learnt all the tricks yet. As others have demonstrated, it is definitely possible to write blazingly fast bitboard programs.
Right now, I am thinking about the following problem: What is the best way to obtain a bitboard of all passed pawns for one side? The obvious way is to loop through all pawns and check each pawn individually, but this is very slow. It seems that the key to making bitboards fast is to avoid having too many loops through the nonzero bits of a bitboard.
I am not interested in solutions involving assembly language. If possible, I would prefer to use code which works for both colours, rather than separate code for black and white pawns.
Tord
I am once again experimenting with bitboards. I have made numerous private rotated bitboard versions of Glaurung over the last year, but they were always slower and less compact than my mailbox versions (even on the 64-bit G5 CPU). The reason is almost certainly that I haven't learnt all the tricks yet. As others have demonstrated, it is definitely possible to write blazingly fast bitboard programs.
Right now, I am thinking about the following problem: What is the best way to obtain a bitboard of all passed pawns for one side? The obvious way is to loop through all pawns and check each pawn individually, but this is very slow. It seems that the key to making bitboards fast is to avoid having too many loops through the nonzero bits of a bitboard.
I am not interested in solutions involving assembly language. If possible, I would prefer to use code which works for both colours, rather than separate code for black and white pawns.
Tord