Author: Dann Corbit
Date: 16:34:09 06/14/01
Using this "darn-fast" branchless first-bit location routine: int FirstPiece(BITBOARD bits) { // if (bits == 0) return -1; __asm { ; 64-bit number to move into ECX:EBX, will never be zero! mov ecx,dword ptr [bits+4] mov ebx,dword ptr [bits] bsf eax,ecx add eax,32 bsf eax,ebx } } I would think that iterating over the board would be just as fast (or possibly faster) than using piece lists. I am curious if others who use bitboards find piece lists to be valuable. I am somewhat surprised to see that FirstPiece() is consuming a lot of CPU.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.