Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Counting Bits in BitBoard

Author: Dann Corbit

Date: 00:36:26 01/07/03

Go up one level in this thread


On January 07, 2003 at 03:22:02, Russell Reagan wrote:

>On January 07, 2003 at 02:56:31, Matt Taylor wrote:
>
>>If his program does population counts often, he may as well use an assembly
>>routine. He doesn't need to write it himself; others have done that.
>
>Even so, it's not going to amount to a hill of beans as long as he uses one that
>is efficient. Unless it's significantly faster it won't make his program any
>better. Even if it made his program run twice as fast, so what? That's not even
>close to an extra ply unless his program is as good as or better than the best
>commercial programs in the world (IE it would need a branching factor of 2.0).
>And let's be realistic, it's not going to make his program go twice as fast
>anyway, and his program isn't among the world's best.
>
>He would be better off putting in an efficient popcount that he understands, and
>working on his evaluation function or searching methods.
>
>>FYI Crafty's population count and LSB/MSB scan routines are in assembly. Refer
>>to X86.s and vcline.h
>
>I was referring to this, from Crafty, boolean.c, which is the default popcount
>(hince the #else).
>
>#else
>
>int PopCnt(register BITBOARD a) {
>  register int c=0;
>
>  while(a) {
>    c++;
>    a &= a - 1;
>  }
>  return(c);
>}
>
>#endif

If you look at the bit counting routines in Pepito (two assembly variants and C
version) the C routines benchmark close enough to the assembly versions that you
cannot tell the difference in performance of the binary.



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.