Author: Tom Kerrigan
Date: 13:20:15 02/13/00
Go up one level in this thread
On February 13, 2000 at 06:01:42, Dan Newman wrote: >It sure is compact. The unbound[ bound[] + vector[][]] thing took me a few >minutes to figure out--and I'm not sure I've got it figured out yet... Do >bound[] and unbound[] map to and from 0x88 coordinates (with the occasional >-1 thrown in for bad coords)? These are my "mailbox" arrays. It should be the 0x88 test, but this particular program does not use 128-square boards. >I guess this code is only the for pieces and not the pawns, since it seems >like it would generate diagonal pawn moves and doesn't have any obvious >promotion code, and ISTR you mentioning separate pawn and piece lists. No, I usually have some special code for pawn move generation because pawn moves are so bizarre. >I'm still not sure what "if (p->bit & 0x22) break;" is about... It's a test to see if the piece can slide. >Anyway, it's nice and compact which is to its advantage, but I suspect it's >probably slower than my code which has a lot of the loops unrolled, uses >constant offsets (which tend to become immediate operations), and very few >array lookups. My 0x88 move generator is pretty ugly of course (about 900 >LOC with lots of macros to make it smaller)... It seems that you are just unrolling one of the loops, and adding a big switch statement. So we probably break even, except that your code is huge, which can screw up the cache. -Tom
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.