Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: significant math

Author: Steffan Westcott

Date: 04:13:51 11/20/02

Go up one level in this thread


On November 20, 2002 at 05:44:10, Sune Fischer wrote:

>On November 20, 2002 at 05:37:43, Steffan Westcott wrote:
>
>>On November 20, 2002 at 05:05:25, Sune Fischer wrote:
>>
>>> I believe that "move for move" 0x88 is faster because you don't have to do
>>> that extra bit scan to get the square
>>
>>Which square are you referring to? Source square? Destination square? I may be
>>able to help you...
>
>With bitboards (as I'm sure you know) you need a piece of assembler using bsf,
>then you need to clear the bit afterwards. This is not needed with 0x88.
>
>ie:
>    while (padvances2) {
>      to=FirstOne(padvances2);
>      *move++=(to+16)|(to<<6)|(pawn<<12);
>      Clear(to,padvances2);
>    }
>
>
>>When using bitboards and looking for a pattern instance for a _single_ square,
>>think again : You should be looking for pattern instances on _all_ squares
>>simulataneously.
>
>Right, I get the idea :)
>
>-S.
>
>>Puzzled,
>>Steffan

Sune,

In your example, you are converting a bitboard (board centric) representation to
a move array (move centric) representation. This would be required if you want
to serialise (list, enumerate) the information. I would advise minimising (and
postponing) the use of code which serialises (converts) the data to a
non-bitboard form. To maximise the potential of your favoured board
representation, it should be pervasive throughout your engine design.

To turn to your example, I would favour using the bitboard padvances2 itself as
a movelist element, rather than chop it up into movelist array elements
(non-bitboards) as your code fragment does.

At some point, a bitboard will need to be serialised ie. bits extracted one at a
time. This should be done as late as possible in the data flow, as it is at this
point the advantages of bitboards dissolve (ie. parallel computation). An
example is at the point of move selection from a bitboard representing some
candidate moves of equal quality (static move evaluation).

I very rarely have a need to find the index of a set bit in a bitboard. This
activity is a conversion from the bitboard representation to a co-ordinate
representation. In an engine design that deals with units of data in bitboard
format, it upsets matters when an co-ordinate format datum (= bit index) is
introduced. Nearly the only case where I need the index is to print out the
move!

Cheers,
Steffan



This page took 0.4 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.