Author: Dan Newman
Date: 14:32:33 02/13/00
Go up one level in this thread
On February 13, 2000 at 16:20:15, Tom Kerrigan wrote: >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. Oh...yeah... > >>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 I've wondered about this. In isolation (which is usually when I end up bloating my move generator like this) it's certainly faster to unroll loops, etc., but once you get a bunch of other things put in this could of course be a problem. But whenever I fiddle around with this code, it just tends to get slower... I just looked at the .obj for the move generator and it's 14k and make/unmake is 16k (for the 0x88). For the bitboard engine these are even larger: 22k and 34 k resp. They are in fact the largest modules in the program with search coming in a close third... -Dan.
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.