Something like this, e.g. to traverse a target bb (x) for movegen:nthom wrote:What do you mean by a serialization loop? Can you post pseudo code?.Gerd Isenberg wrote: Can you post the generated 64-bit assembly of a typical bitboard serialization loop? What is your processor?
Code: Select all
if ( x ) do {
int idx = bitScanForward(x); // square index from 0..63
*list++ = foo(idx, ...);
} while (x &= x-1); // reset LS1B
That should be fast as hell with 64-bit bsf.nthom wrote:I'm testing on a Phenom 9550 quad core.