Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Question for Gerd: reduce rbb lookup tables

Author: Robert Hyatt

Date: 11:44:16 07/15/03

Go up one level in this thread


On July 14, 2003 at 19:38:40, Sune Fischer wrote:

>On July 14, 2003 at 18:59:16, Gerd Isenberg wrote:
>>
>>Read again, the ShiftL45[s] lookup is not necessary.
>>
>>__forceinline
>>BitBoard A1H8Attacks(unsigned int sq) const
>>{
>>  return sA1H8Atta[sq]
>>   [(*(((BYTE*)&(m_OccuBBA1H8))+((sq-Rank(sq))&7))&0x7e)>>1];
>>   // diaindex = (file-rank) & 7
>>}
>>
>>Gerd
>>
>
>Thanks Gerd, I'll think it over.
>
>My transformation is a little different I think, though you also have one shift
>and one AND, you've just replaced the table with some "magic", could be faster I
>guess.
>
>I once heard that working with byte size variables is slower than native
>integers (32 bit) sizes, so I'm not fully convinced 8 bit casting it that much
>faster(?).
>
>-S.

The point of 8 bit stuff is that while it might execute a cycle slower, it is
much more cache-friendly.  That pays off big overall.  IE 64 chars vs 64 ints
is a 75% cache footprint reduction.

I do a lot of that in Crafty, and trust me, I benchmarked both ways before
leaving the char stuff in.  :)



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.