Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash table allocation

Author: Dieter Buerssner

Date: 14:21:59 08/26/03

Go up one level in this thread


On August 26, 2003 at 16:51:09, Gerd Isenberg wrote:

>What about to save the modulo:
>
>UINT64 keyxy = (hashcode & 0xffffffffUL) * number_of_entries;
>index = (unsigned long) (keyxy >> 32);
>
>Didn't you introduced these index trick here before?
>To do a fast 32-bit*32-bit = 64-bit multiplication.

Yes, it was me. Thankfully you mentioned it, so I would not feel to foolish to
give yet another different answer in a new post :-)

One should perhaps check the assembler output, and might need to add a cast to
convince the compiler to produce good code (so that it sees, that really that
32*32-bit -> 64-bit multiplication is needed).

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.