Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about speed and bitboard

Author: Michael Henderson

Date: 19:22:24 09/16/04

Go up one level in this thread


On September 16, 2004 at 21:20:50, Uri Blass wrote:

>What is faster doing a loop on the 1's of a bitboard or doing a loop on array of
>integers
>
>I simply consider to change my knight move generator to bitboards
>
>Today I have array
>int knightmove[64][8] and the question is if getting
>knightmove[c3][0],...knightmove[c3][7] is faster or slower than getting the same
>squares by calculating the 1's of knightoption[c3] in order to get the squares
>that the knight can go.
>
>I also consider to have bitboard knightcapturewhite[64] knightcaptureblack[64]
>and knightquietmoves[64] that are going to be updated incrementally after every
>move and the question is what is the price of this in speed.
>
>Do people who use bitboards have experience with it?
>
>Uri

I have never tried that with my bitboard program but here are my thoughts:
knightmove[64][8] would take at least two lookups and at most eight, but
probably the extra memory traffic won't matter.  knightoption[c3] stuff is
probably better for cache.  Also important is the fact that you want the
bitboard representation of the moves so you can do binary operations with them
i.e. knightmoves[c3] & blackPieces -- if no captures, no further work required
(not the case with knightmove[0][a] strategy).  That makes it a win for qsearch
and capture generation.

I don't think that updating the knightmoves won't gain you any noticeable
improvement if at all, maybe just overhead.  I would just do bitboard lookup and
binary operation which is very fast.

hope that helps,
Michael



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.