Author: Gerd Isenberg
Date: 00:06:54 09/20/04
Go up one level in this thread
On September 20, 2004 at 02:23:59, Tony Werten wrote: >It isn't doing things parallel like the sliders with Kogge Stone, but at least >it doesn't use those big arrays. > >const KNIGHTC3 // all attacks of a knight on square C3 > >pieces=BITBOARD[stm][KNIGHT]; >attacks=0; >while (pieces) >{ > sq=bitscan_first_and_reset(pieces); > File(sq)>2 ? mask=NOT_FILE_AB:mask=NOT_FILE_GH; > if (sq>C3) attacks=(KNIGHTC3>>(sq-C3)) & mask; << > else attacks|=(KNIGHTC3<<(C3-sq)) & mask; ?? >> >} > >For king is the same but on square B2. Since most of the time sq>C3 (or B2) >branch prediction should be OK. Even more for sq>=C3 (or b2). > >Tony
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.