Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: a bitboard question

Author: Robert Hyatt

Date: 07:13:37 01/14/01

Go up one level in this thread


On January 14, 2001 at 00:36:52, Uri Blass wrote:

>I am interested to know what is the fastest way that is known to evaluate
>mobility in bitboard when the definition of mobility is the weight of the number
>of squares that the pieces control.
>
>For example if a bishop at c1 controls the squares d2,e3,f4,b2,a3 then the
>mobility of it is
>weightbis[d2]+weightbis[e3]+weightbis[f4]+weightbis[b2]+weightbis[a3] when
>weightbis is an array(I can call it a mobility square table).
>
>I am interested to know if bitboard is faster or slower than other ways to
>calculate this evaluation.
>
>Uri

Depends on the hardware.  On the Cray, you can create a 64-word array that
has a "weighted score" for each square on the board.  You can compute this
dynamically based on the current position, or else statically as a normal
piece/square table.  You then take the bitmap for squares the bishop attacks,
and use that as a vector mask in the 'vector merge' instruction.  That will
extract the words from the 64 word array where you have a 1 in the bitmap.

If you treat every square as equal, it is easy without the cray-type
architecture...

If you mean (by control) that you only count squares that the bishop can
move to safely, that is a bit harder, but doable, by simply computing the
squares the bishop attacks, the squares that are 'safe' to move to (this
is going to be a fairly slow operation but it could be done as part of
other operations like move generation) and then ANDing those two bitmaps
to get a list of safe squares the bishop can move to...

almost anything _can_ be computed.  The question is whether the cost of the
computation outweighs the result or not.




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.