Author: Russell Reagan
Date: 14:28:23 01/25/03
Go up one level in this thread
On January 25, 2003 at 15:30:46, David Rasmussen wrote: >Wanting to implement common bitboard operations (FirstBit(), PopCount() etc.) on >IA32, what is the most natural orientation to choose? I think a1=0, b1=1, ... is >more natural than a8=0, a7=1, ..., in the sense that the code for, say, >FirstBit(), in IA32 assembler will be more effecient in the first than in the >latter. As far as implementing a FirstOne() and PopCount(), I don't think it matters about the order of the bits or what they mean. Certainly the PopCount() doesn't matter, since it is just the count of the set bits, and the order doesn't matter at all. FirstOne() will *usually* not matter, but it might sometimes. For instance, when generating moves (like Crafty does), it calls the FirstOne() function just to say, "tell me where another piece is". Crafty doesn't really care where that piece is, so FirstOne() *could* return any of the indexes that a piece is on (instead of the least significant bit or most significant bit) and it would still work fine. Sometimes you might actually need to know the least significant bit or most significant bit, so it might matter there. In general it isn't going to matter though, and in general, it isn't going to affect the strength of your engine unless these functions are just horribly inefficient. Otherwise, maybe 1-2 elo.
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.