Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: flood fill attack bitboards

Author: Sune Fischer

Date: 04:31:43 09/16/02

Go up one level in this thread


On September 16, 2002 at 02:19:16, Gerd Isenberg wrote:

>My current attack routines (member of CNode) have only one int parameter.
>So i have to use some conditional compiled inlines:
>
>__forceinline BitBoard CNode::GetRookAttacks(int sq) {
>	return getRookAttacksMMX( freeSquares(), 0x0...0001<<sq);}
>
>I fear, when i only replace all my sliding Lookup-getters GetFileAttacks,
>GetA1H8Attacks... in this way, the flood fill mmx aproach will lose. The
>mmx-execution latencies are mostly two cycles, rather then the one cycle for
>similar instructions with standard registers (and there are three pipes for
>standard int instructions). Also most sliding attack getter (exclude
>getQueenAttacks) are forced inliners. Inlining asm-funtions have the drawback of
>parameter passing via stack (maybe solvable by passing the parameters already in
>mmx-register).
>
>But i will try it and report about it, as proposed. Have to think about doing a
>lot of conditional compiles or starting a new test project.
>
>It will gain from the lack of incremental updating the three rotated occupied
>bitboards, but i think it's necessary to change programs infrastructure somehow
>to gain more from the simultanious feature.

Yes, first thing I noticed too. It has several advantages over rotated in fact.
It doesn't need tables, it can construct attack boards in parallel if there are
more than 1 rook or bishop, this could boost the InCheck function quite a bit.
And of course you aren't wasting time updating anything incrementally when there
aren't sliders on the board.

At least it is now possible to make a tiny (few kB) bitboard engine, I'm sure
that will come in handy when the chips reach 10-20 GHz.
Maybe MMX isn't fast enough today but who knows with hyperthreading and future
technologies how much such a thing can be tuned.
The Hammer should be faster at this than MMX, so perhaps it could be a winner
already in a few months, what do you think?

>One possible improvement for the single square getters could be the use of four
>routine variations with less fill iterations (4..7). Two function pointer arrays
>indexed by square index, with respect of the maximal lenght of a ray in each
>direction for straights or diagonals.

No, tables, pointers and conditionals are forbidden, only pure bitwise
operations. We never know if future chips may have some bad pipeline thingy
mispridiction problem yada yada.

>An interesting feature of this routines may be looking for all squares
>attackable after all possible moves by the sliders. You only need two
>consecutive calls.

Yes, that is true, so you can get rid of your 'taxi-distance' table too, just
count the iterations here!

-S.

>Cheers,
>Gerd



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.