Author: Bas Hamstra
Date: 07:11:08 01/21/03
Go up one level in this thread
On January 21, 2003 at 06:04:56, José Carlos wrote: >On January 21, 2003 at 05:46:37, Bas Hamstra wrote: > >>Hi Russell, >> >>Question: Why do you calculate KnightAttacks the way you do? Why not simply >> >> KnightAttacks(Sq) = KnightAttMask[Sq]; >> >>One memory lookup in a small precalculated table KnAtt[64] should be much much >>faster. For the rest I am interested to test the speed of the C-style fill >>routines against rotated BB. Will be slower, but how much? >> >>Bas. > > It can be useful for any calculation you can do in parallel. For example, you >might want to know which of your pieces are attacked by opponent light pieces. >For simplicity, let's suppose you're only interested in knight attacks. Then >you do: > > KinghtAttacks(MyPieces) & OpponentKnights > > If don't know if it is faster than extracting the bits from OpponentKnights, >doing the table lookup and matching it against MyPieces, but it's simpler. No, the table lookup is practically FREE. Remember this is just a small table, that basically remains in cache. The computation OTOH does a big number of expensive shifts for nothing. Also I fail to see why it is simpler... Bas.
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.