Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: IsiChessMMX without rotated BitBoards...

Author: Steffan Westcott

Date: 15:08:40 10/15/02

Go up one level in this thread


On October 15, 2002 at 17:10:48, Russell Reagan wrote:

>On October 15, 2002 at 13:24:37, Steffan Westcott wrote:
>
>>BitBoard FillUpOccluded(BitBoard g, BitBoard p)
>>{
>>           g |= p & (g <<  8);
>>           p &=     (p <<  8);
>>           g |= p & (g << 16);
>>           p &=     (p << 16);
>>    return g |= p & (g << 32);
>>}
>
>That's interesting. I have two questions.
>
>First, how does this compare to a classic ray tracing approach? It seems like
>both methods would use around the same number of instructions, but your routine
>is constant in the number of instructions, while the ray tracing approach is
>not. There are also branch mis-predictions to worry about with the ray tracing
>method.

I'm unclear what you mean by the "classic ray tracing approach". Anyhow, there
are so many variable factors to take into account, such as the type of
processor, so I couldn't give a definitive answer. Gerd's work in this area
would seem to suggest that it is of benefit for his engine vs. conventional
lookup table methods, but only after considerable effort on his part.

>Second, this method seems like it partially solves the need for rotated
>bitboards. You would be able to compute the file moves and attacks using this
>method, but what about diagonal moves and attacks, such as for bishops? Do you
>have any similar method for solving that?

Sure, this method can be used for any sliding direction. For brevity, I
sustituted ShiftUp(b) for (b << 8) in the example. I posted here previously some
background on parallel prefix problems, which explains the theory behind my code
example. Forgive me that I don't repeat it here, as it was rather long. The
articles haven't made it into the CCC archives yet. Mail me if you want a copy.

>I don't care for rotated bitboards much myself, so I'd like to find a nice way
>to avoid them if I can.

I share your view on this point. For some architectures, bit level computation
makes much more sense than lookup tables.

>Thanks for the examples.

No problem - Share and enjoy!

Cheers,
Steffan



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.