Author: Gerd Isenberg
Date: 10:09:05 10/30/01
Go up one level in this thread
On October 30, 2001 at 12:08:31, J. Wesley Cleveland wrote: >On October 30, 2001 at 09:21:49, Gerd Isenberg wrote: > >[snip] >>For the four preprocessed xxx_attacks[square][status] arrays it's not necessary >>to use all 8 squares on xxx for occupied status, the inner six squares are >>enough - so use xxx_attacks[64][64] instead of xxx_attacks[64][256]. > >Don't you have to do a mask and a shift to get your index then ? Have you done >measurements to see if this is better than the larger arrays ? On my hardware (Athlon 1333) / compiler (MSC++) / optimization it's a bit faster ( ~1%), not a big deal and it may also depend on the testset, but i save some memory space. The additional shift and mask seems to be very cheap, even in my case with a Byte-access to get the occupied squares( otherwise you have to shift and mask anyway). May be you got a few more cache hits, specially when the outer occupied bits chance - leaving the 6bit status constant. Gerd
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.