Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about speed and bitboard

Author: Robert Hyatt

Date: 07:38:03 09/19/04

Go up one level in this thread


On September 18, 2004 at 17:12:23, E. Nielsen wrote:

>On September 16, 2004 at 21:20:50, Uri Blass wrote:
>
>>...doing a loop on the 1's of a bitboard...
>
>Well, I suppose it depends on which representation you choose for your
>bitboard...
>
>If it is in two's-complement form (i.e. signed) you can find the rightmost 1-bit
>with following formula:
>
>                           x & (-x)
>


Finding the bit is not quite the same as finding the identity or number of the
bit.  IE findihg bit for square e4 is easy.  But if you want to know if it is
the e4 square, id bit # X, then that is harder.  Fortunately modern processors
can do this easily...




>
>Regards,
>EyĆ°un Nielsen
>
>P.s.: And I would also recommend the book "Hacker's Delight" by Henry S. Warren,
>Jr. which is full of stuff like this. :)



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.