Author: Gerd Isenberg
Date: 12:54:20 01/08/03
Go up one level in this thread
On January 08, 2003 at 14:31:10, Ed Schröder wrote:
>On January 08, 2003 at 12:41:39, Gerd Isenberg wrote:
>
>>On January 08, 2003 at 04:43:12, scott farrell wrote:
>>
>>>My chompster is bit board .... bit boards rule 4ever !!!
>>>
>>>I really like Ed's code for eval/SEE, call it what you like, by calculating all
>>>the attack and defend squares.
>>>
>>>MSCP does this to a lesser extent.
>>>
>>>Crafty doesnt seem to do it at all. Robert, am I correct here? do you eval each
>>>square in a 64 byte array at all? I couldnt see it.
>>>
>>>Having used bitboards in chompster I have almost no loops anywhere in my
>>>program. 1 or 2 for move generation, and 1 for move ordering and 1 for searching
>>>each move, and only a very few in eval but all guarded by a simple bit board &
>>>so they dont fire too often.
>>>
>>>The only way I can think to implement the above, it to iterate over each
>>>attackBoard for each piece, which I have available during eval, but I dont
>>>really want to iterate over it, yuk ... too sssllloooowwwww.
>>>
>>>It seems to me, without bit boards, you have to iterate everything, so it seems
>>>no problem to be iterating over attack vectors. But for us bit-boarders it seem
>>>ugly (too me anyway).
>>>
>>>All I could think of was to keep each attackVector for each piece. And when
>>>traversing each quare on the board, do something like this:
>>>
>>>for (sq=0; sq<64;sq++){
>>> if( (mask[sq] & whiteQueenAttacks) !=0)
>>> attackers++;
>>> if( (mask[sq] & blackQueenAttacks) !=0)
>>> defenders++;
>>> ......
>>>}
>>>if (attackers>defenders)
>>> ATTACK_NOW_!!!!!
>>>
>>>atleast this method I dont have ot itereate the actuall attack vectors, and
>>>avoid slow msb/pop type routines.
>>>
>>>Any help / ideas appreciated.
>>>
>>>Scott
>>
>>Hi Scott,
>>
>>yes, Ed's control structure is really nice to have, specially if they are used
>>as indices of a two dimensional 256*256 table, to get a precalculated is enprise
>>or hanging information for pieces etc.
>
>
>>But with attacked bitboards it is probably smarter to use a bitboard based
>>approach for hanging or enprise squares or pieces, which may generated in a
>>loopless, unconditional way like below (on the fly, hope you get the idea).
>
>Yes Gerd, this is probably most true. I never had the time to put energy in the
>bit-boards technique. Do you have any idea about the number of clocks needed to
>extract the hanging pieces from a position using bitboards?
>
Hi Ed,
currently i redisign some parts of my engine, mostly the bitboard infrastructure
with hammer in mind...
Actually i use an other approach near the tips and in q-search, only considering
pawn attacks and allAttacks (generated by a special mmx routine based on
Flood-Fill and KoggeStone).
So no idea about the cycles used on the fly. The get allAttacks, which actually
looses informations due to lack 64-bit registers (only eight mmx) takes about
100ns on my 2.1XP+. It uses Kogge-Stone Flood-Fill for Rooks|Queen and
Bishops|Queen, and an parallel fill for Knights, Pawns and King, only with
mmx-registers, a lot of parallel work, up to four independend instructions in a
row.
>
>>A lot of this stuff may be done in the near future with hammers MMX- or
>>XMM-registers.
>
>Or just when 64-bit becomes the standard.
>
Yes, but specially for this purpose and fill-algos hammers eight MMX-registers
and 16 128-bit XMM-registers are very cool.
Regards,
Gerd
>Ed
<snip>
eg. this one
valDom[W] = (pawnDblAttacks[W] & ~pawnDblAttacks[B])
| (pawnAttacks[W] & ~pawnAttacks[B])
| (KnBiAttacks[W] & ~KnBiPaAttacks[B])
| (rookAttacks[W] & ~RKnBiPaAttacks[B])
| (queenAttacks[W] & ~QRKnBiPaAttacks[B])
| (kingAttacks[W] & ~allAttacks[B]);
valDom[B] = (pawnDblAttacks[B] & ~pawnDblAttacks[W])
| (pawnAttacks[B] & ~pawnAttacks[W])
| (KnBiAttacks[B] & ~KnBiPaAttacks[W])
| (rookAttacks[B] & ~RKnBiPaAttacks[W])
| (queenAttacks[B] & ~QRKnBiPaAttacks[W])
| (kingAttacks[B] & ~allAttacks[W]);
can be combined with 128-bit registers:
valDom[W:B] = (pawnDblAttacks[W:B] & ~pawnDblAttacks[B:W])
| (pawnAttacks[W:B] & ~pawnAttacks[B:W])
| (KnBiAttacks[W:B] & ~KnBiPaAttacks[B:W])
| (rookAttacks[W:B] & ~RKnBiPaAttacks[B:W])
| (queenAttacks[W:B] & ~QRKnBiPaAttacks[B:W])
| (kingAttacks[W:B] & ~allAttacks[B:W]);
may be a sequence of
pandn xmm0, mxx1
pandn xmm2, mxx3
pandn xmm4, mxx5
pandn xmm6, mxx7
pandn xmm8, mxx9
pandn xmm10,mxx11
por xmm0, xmm2
por xmm4, xmm6
por xmm8, xmm10
por xmm0, xmm4
por xmm0, xmm8
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.