Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Mixing 0x88 and bitboards

Author: Robert Hyatt

Date: 17:01:03 06/25/02

Go up one level in this thread


On June 25, 2002 at 17:27:43, Gian-Carlo Pascutto wrote:

>On June 25, 2002 at 17:04:43, Robert Hyatt wrote:
>
>>What about more commonly:  Is the black pawn on e6 passed.  Now you have
>>to check 12 squares...  d2/e2/f2, d3/e3/f3, d4/e4/f4, d5/e5/f5.
>>
>>Bitmaps:  two loads one and.  No compare.  Just a branch not zero.
>>
>>traditional...  12 loads 12 compares.
>
>More like...1 load 1 compare.

How will you check 12 squares with one load and one compare???

>
>>Asking simple questions with bitmaps is not so good on 32 bit machines.  On
>>a 64 bit machine, your above becomes
>>
>>1 load.  1 mask create (set 1 bit and shift, two instructions, done in the
>>"shadow" of the load, then one compare.
>>
>>On a 64 bit machine, they are equally fast for the simple operation.  For
>>the second case, the 64 bit machine is an easy winner.
>
>At 32 bits, the nonbitboard approach wins out. At 64 bits, it's still
>'better' (not slower and uses less functional units).


I don't agree there.  At 64 bits, I do one 64 bit load and answer the
question.  I don't see how you can beat that with 32 bits.  If you are
doing bitmapping on 32 bits, you might by knowing which half to load,
but a 32 bit load and a 64 bit load take exactly the same amount of time.
So even by being cute, your 32 bit bitmap program is no faster...  And I
don't see how to do this in an offset approach with one instruction.  If
you try to keep some incremental stuff to avoid checking the 12 squares
then there is a cost for doing that as well...



>
>I'm not saying there aren't things that are faster with bitboards,
>I'm just saying there certainly are things that are faster without.

No doubt that is true.  But if things break even on 32 bit machines,
then 64 bit machines change that in favor of the bitmap programs, by
some positive amount open to debate.

>
>--
>GCP



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.