Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bob & Eugene: PopCnt64()

Author: Eugene Nalimov

Date: 11:39:43 04/25/01

Go up one level in this thread


In Crafty usually you have zero or one set bits in the PopCnt's argument. So the
simplest version is the fastest, especially when it is inlined.

Eugene

On April 25, 2001 at 14:31:27, Bas Hamstra wrote:

>inline int PopCnt(BB M)
>{   unsigned char *p = (unsigned char*) &M;
>    return PopCnt8[p[0]]+PopCnt8[p[1]]+PopCnt8[p[2]]+PopCnt8[p[3]]
>           +PopCnt8[p[4]]+PopCnt8[p[5]]+PopCnt8[p[6]]+PopCnt8[p[7]];
>}
>
>Last time I tested, on my Celeron the above PopCnt was way faster than Crafty's
>asm version. Am I overlooking something? Maybe because my compiler refuses to
>inline asm statements?
>
>
>Bas.



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.