Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: FirstOne/LastOne

Author: milix

Date: 09:32:37 06/13/04

Go up one level in this thread


UINT32 WalterFaxonsMagicBitscan(BitBoard &bb)
{
    BitBoard t64;
    UINT32 t32;
    t64 = bb - 1;
    bb &= t64;  // omit this line to retain current LSB
    t64 ^= bb;
    t32 = (UINT32)t64 ^ (UINT32)(t64 >> 32);
    t32 ^= LSB_64_magic;
    t32 += t32 >> 16;
    t32 -= t32 >> 8;
    return LSB_64_table [LSB_64_adj + t32];
}

// omit this line to retain current LSB
is this really correct? If we omit this line we have to change the next line to
t64 ^= (bb & t64);



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.