Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about speed and bitboard

Author: E. Nielsen

Date: 04:18:09 09/20/04

Go up one level in this thread


On September 19, 2004 at 12:28:35, Gerd Isenberg wrote:

>On September 19, 2004 at 10:38:03, Robert Hyatt wrote:
>
>>On September 18, 2004 at 17:12:23, E. Nielsen wrote:
>>
>>>On September 16, 2004 at 21:20:50, Uri Blass wrote:
>>>
>>>>...doing a loop on the 1's of a bitboard...
>>>
>>>Well, I suppose it depends on which representation you choose for your
>>>bitboard...
>>>
>>>If it is in two's-complement form (i.e. signed) you can find the rightmost 1-bit
>>>with following formula:
>>>
>>>                           x & (-x)
>>>
>>
>>
>>Finding the bit is not quite the same as finding the identity or number of the
>>bit.  IE findihg bit for square e4 is easy.  But if you want to know if it is
>>the e4 square, id bit # X, then that is harder.  Fortunately modern processors
>>can do this easily...
>
>9 cycles vector path isn't that easy for bsf/bsr on AMD64 ;-)
>
>For moves i like the idea of a 64-bit de Bruijn multiplication with the
>difference of two single from/to bits. Using the upper 11/12 bits as a unique
>result index per piece.
>
>A source piece specific lookup, to get either from/to squares of the move,
>and/or a unique move index over all kinds of pieces, even considering possible
>captured pieces.

Hi,

Thanks a lot for the hint on de Bruijn multiplication. It seems to speed things
up a bit for me. :-)

Regards,
Eyðun Nielsen

>
>
>>
>>
>>
>>
>>>
>>>Regards,
>>>Eyðun Nielsen
>>>
>>>P.s.: And I would also recommend the book "Hacker's Delight" by Henry S. Warren,
>>>Jr. which is full of stuff like this. :)



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.