Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboards

Author: James Long

Date: 17:42:58 12/09/98

Go up one level in this thread


On December 09, 1998 at 05:32:15, Dan Newman wrote:

>On December 06, 1998 at 10:23:54, Robert Hyatt wrote:
>
>>I haven't finished this yet...  I've sent it to a couple of people in draft
>>form when they asked...  And will do the same for you if you are interested.
>>Note that it is a rough draft, reasonably complete, but not "polished" yet...
>
>I'd be interested in a copy too (hope you're not too inundated with
>requests).   email:  dnewman@bellatlantic.net
>
>After reading the lastest posts on bitboards, I've begun trying my
>hand at them (again).  The main sticking point with me was the cost
>of bit index extraction--I was only able to get bitboard move
>generation to go at about half the speed of 0x88.  But, I just did
>an experiment with the BSF instruction (inline assembly) and have
>gotten the best results yet--something less than 9 clocks per
>bit-index on a P6.  My previous best was 16 clocks using pure C.
>
>One trick I just discovered (which is pretty obvious actually) is
>using XOR to clear the bit:  I had been doing this:
>
>      bitboard &= ~(1 << index);
>
>but this can be done, saving one operation, like this:
>
>      bitboard ^= (1 << index);

Better yet precompute the mask for each square's bit,
and just do something like:

      bitboard ^= bb_mask[index];

--
James


>
>since we know the bit is set.
>
>-Dan.



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.