From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7211 invoked by alias); 16 Oct 2004 18:35:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7187 invoked from network); 16 Oct 2004 18:34:59 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 16 Oct 2004 18:34:59 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9GIYopW002253; Sat, 16 Oct 2004 14:34:55 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9GIYmr28167; Sat, 16 Oct 2004 14:34:48 -0400 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id i9GIYPFC001673; Sat, 16 Oct 2004 14:34:25 -0400 Received: (from jakub@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) id i9GIYPbt001671; Sat, 16 Oct 2004 14:34:25 -0400 Date: Sat, 16 Oct 2004 18:37:00 -0000 From: Jakub Jelinek To: Richard Henderson , Matt Austern , GCC Patches Subject: Re: [Committed] Use special-purpose hash table to speed up walk_tree Message-ID: <20041016183424.GC31909@devserv.devel.redhat.com> Reply-To: Jakub Jelinek References: <20041016094708.GZ31909@devserv.devel.redhat.com> <20041016103712.GA31909@devserv.devel.redhat.com> <20041016182952.GA31659@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041016182952.GA31659@redhat.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2004-10/txt/msg01344.txt.bz2 On Sat, Oct 16, 2004 at 11:29:52AM -0700, Richard Henderson wrote: > On Sat, Oct 16, 2004 at 06:37:12AM -0400, Jakub Jelinek wrote: > > + choice for A is the integer part of (ULONG_MAX + 1.0) / phi, where phi > > + is the golden ratio. > > Any reason not to use the computation actually described here? You mean doing the computation in FPU? > Otherwise, the ifdef one's fine if you use HOST_BITS_PER_LONG > to choose one of the alternatives exactly: > > #if HOST_BITS_PER_LONG == 32 > const unsigned long A = 0x9e3779b9u; > #elif HOST_BITS_PER_LONG == 64 > const unsigned long A = 0x9e3779b97f4a7c16ul; > #endif > > Which will handily not compile if we ever find something else. Yeah, that looks better. Jakub