Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: BitScan with reset - not so impressive with 3DNow!

Author: Russell Reagan

Date: 20:27:46 12/04/02

Go up one level in this thread


On December 04, 2002 at 17:13:02, Russell Reagan wrote:

>Good point. It could be even better than you think. For example, when the time
>comes when we can get rid of the board array in bitboard programs, and
>efficiently determine what piece is on a given square from the bitboards alone,
>it would be sufficient to use the b & -b trick to get a bitboard with the lowest
>bit set, and you could simply use that as a "from mask" for the piece being
>moved. But since we have the board array, you need an index, not just a 64-bit
>mask.

I did some tests. I wrote a function to determine which piece is on a square
using only bitboards. It's just a bunch of if statements. Suprisingly, the
if-version of "what piece is on this square" is only about twice as slow as the
"piece = squares[i];" version. I went on and did some testing with the b & -b
method and I found that for move generation, it's about 15% faster than the
version that uses bsf. Not only that but my make move function will be faster
too, but I haven't had time to test how fast yet. I was just testing to see if
this was faster, and since it is, I'm going to go ahead and switch over to it.

I'm starting to really like this. Non-rotated bitboards, no need for a
first_one() type function, and virtually no lookup tables.

Russell



This page took 0.01 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.