From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Allister MacLeod Newsgroups: gmane.lisp.guile.user Subject: Re: Does anyone have a better scm_string_hash ? Date: Mon, 17 Nov 2003 11:48:20 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20031117164819.GA28322@mv3d.com> References: <8765hnf308.fsf@zagadka.ping.de> <1068823738.13123.54.camel@localhost> <20031114155148.GI16650@powergnu.laas.fr> <1069058032.1638.21.camel@localhost> <874qx3rogk.fsf@zagadka.ping.de> <87u153q8yk.fsf@zagadka.ping.de> <87n0avq7pf.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1069088663 25930 80.91.224.253 (17 Nov 2003 17:04:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2003 17:04:23 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 17 18:04:19 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ALmnT-0006Uw-00 for ; Mon, 17 Nov 2003 18:04:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ALnjx-0006fl-BJ for guile-user@m.gmane.org; Mon, 17 Nov 2003 13:04:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ALnil-0006MF-8F for guile-user@gnu.org; Mon, 17 Nov 2003 13:03:31 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ALnfg-0005Qy-2s for guile-user@gnu.org; Mon, 17 Nov 2003 13:00:51 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1ALnfd-0005HQ-Hy for guile-user@gnu.org; Mon, 17 Nov 2003 13:00:17 -0500 Original-Received: from [24.218.48.114] (helo=mv3d.com) by mx20.gnu.org with esmtp (Exim 4.24) id 1ALmY6-0001B2-3y for guile-user@gnu.org; Mon, 17 Nov 2003 11:48:26 -0500 Original-Received: by yogmoth (Postfix, from userid 1000) id 121591200B0; Mon, 17 Nov 2003 11:48:20 -0500 (EST) Original-To: guile-user@gnu.org Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline In-Reply-To: <87n0avq7pf.fsf@zagadka.ping.de> User-Agent: Mutt/1.5.4i X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2401 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2401 On Mon, Nov 17, 2003 at 05:29:48PM +0100, Marius Vollmer wrote: > Marius Vollmer writes: > > Just for kicks, I'm now going to see what kind of code GCC generates > > for h*37 as compared to (h<<5) + (h<<2) + h... > Interesting. For h =3D a + (h<<5) + (h<<2) + h we get this sequence > (one line is one machine instruction): > x =3D h > x =3D x << 5 > a =3D a + x > a =3D a + h*4 > h =3D a + h > and for h =3D a + h*37 we get > x =3D h + h*8 > x =3D h + x*4 > h =3D x + a*1 > which is nearly twice as clever... Just for reference, what are the timings on a Pentium for these instructions? I assume from your pleased comments that assign-from-plus-and-multiply is sufficiently fast that two of them are less costly than a pair of assign-from-plus, an assign-from-shift, and an assignment. I'm curious as to why the last line of the second way ends up being h=3Dx+a*1, instead of h=3Dx+a. Are a series of same-width instructions faster than ones with different widths? (gawd, CISC rox, bleh) Cheers, Allister --=20 Allister MacLeod | http://amacleod.is-a-geek.org/ Elen s=EDla l=FAmenn'omentielvo. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user