Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitscanning on the Opteron

Author: Sune Fischer

Date: 13:15:51 12/05/03

Go up one level in this thread


On December 05, 2003 at 13:43:05, Russell Reagan wrote:

>On December 05, 2003 at 07:20:37, Gerd Isenberg wrote:
>
>>Was it your intention to mix lsb- with msb-routines?
>
>For this program they produce the same checksum since all of the bitboards have
>a population of one (msb == lsb, in this test).
>
>It probably doesn't matter for a lot of bitboard chess programs. For most, any
>bit will do. For some it matters. I know for some of the filler stuff I've
>written I had to make sure I used a lsb or msb. I think both will be
>approximately the same speed, or very close.

You can optimize some of the routines to take advantage of that.
For instance you save the &'s in the TableBitscan16 version:

int TableOneBitscan16 (Bitboard b) {
    if (b<<48)
        return table16[b];
    if (b<<32)
        return table16[b >> 16] + 16;
    if (b<<16)
        return table16[b >> 32] + 32;
    return table16[b >> 48] + 48;
}

-S.



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.