because i try to design my engine-concept with incremental attacksets
i have to make a decision of the following issue.
Code: Select all
//------------------------------------------------------------------------------
// access on bitset by list-type
// requires one extraction per stage (by bitscan),
// ex: attack-sets may be handled like this...
//struct LIST_T
// {
// UI_08 len;
// UI_08 id[64];
// };
//------------------------------------------------------------------------------
void loopExtracted(UI_16 id)
{for(UI_08 i=0;i<list[id].len;i++) nmb^=list[id].id[i];return;}
//------------------------------------------------------------------------------
// direct extraction of bitset by bitscan
//------------------------------------------------------------------------------
void loopCompact(UI_64 bb)
{while(bb){nmb^=bsf64(bb);bb&=bb-1;};return;}
//------------------------------------------------------------------------------
// nmb is just a global that doesnt do anything. it should only avoid
// compiler optim. for my testloops...
//------------------------------------------------------------------------------
than the _pop1_ version (on the same data). And that is the problem.
Maybe on fast bitscan machines the _pop1_ version performs as
well as the _extractedLoop_ version.
Now i am interested in what kind of version you would prefer and
the reasons for, of course.
(as mentioned, i want to use the indices of attacksets for movegeneration,
evaluation terms..., so one extraction per stage seems logic with later
access to the indices by list-data-structure _IF_ that would perform at least equal on fast bitscan machines)
Micha