Author: David Rasmussen
Date: 14:54:58 01/25/03
Go up one level in this thread
On January 25, 2003 at 17:28:23, Russell Reagan wrote: > >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. Of course it doesn't matter for PopCount(), that was my mistake. But it's certainly important very often to know where a piece is, so it is certainly a good idea for FirstOne() to return something that matches your indexing. And orientation is definitely important here. On the other hand, it would be interesting to know if one could make an even faster function (called SomeBit()) than a normal FirstBit() in IA-32 assembly, if the order of the returned bits did not matter. For movegen a function returns the index of such a bit and also clears it, would be useful, if it meant that it could be done even faster. /David
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.