Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: hash table size - is a power of 2 still an advantage these days?

Author: Dieter Buerssner

Date: 13:39:58 09/28/03

Go up one level in this thread


On September 27, 2003 at 20:22:21, Johan de Koning wrote:

>The following two expressions generate different addresses.
>
>base + (size * zob_lo >> 32) * sizeof(entry)   // original trick
>base + (size * sizeof(entry) * zob_lo >> 32)   // optimized but wrong

You are right. I stand corrected.
No idea, what I had thought. Sorry for the confusion, and thanks for pointing
out my error. The "optimized" trick can work with sizeof entry a power of two by
anding a mask (~(sizeof(entry) - 1)) to the offset. But in this case adress
calculation from the index is fast anyway (will at most need a shift, if
anything).

Regards,
Dieter



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.