From owner-cvs-all Thu Aug 15 22:41:12 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 592F837B400; Thu, 15 Aug 2002 22:41:05 -0700 (PDT) Received: from root.com (unknown [209.102.106.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A99343E3B; Thu, 15 Aug 2002 22:41:04 -0700 (PDT) (envelope-from dg@root.com) Received: (from dg@localhost) by root.com (8.11.2/8.11.2) id g7G5WBh50721; Thu, 15 Aug 2002 22:32:11 -0700 (PDT) (envelope-from dg) Date: Thu, 15 Aug 2002 22:32:11 -0700 From: David Greenman-Lawrence To: Alfred Perlstein Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket2.c Message-ID: <20020815223211.F42978@nexus.root.com> References: <200208160508.g7G58kRZ098250@freefall.freebsd.org> <20020815221609.E42978@nexus.root.com> <20020816052726.GN75574@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020816052726.GN75574@elvis.mu.org>; from bright@mu.org on Thu, Aug 15, 2002 at 10:27:26PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >> I'm looking at calcru() as well, since is does four 64bit divides and >> was as expensive as sbreserve() in my profiles. The __qdivrem function >> that does the 64bit divide appears to consume several thousand instructions >> in the common case. Something to avoid if at all possible. > >Any idea on how to setup warnings when some threshold of 64 bit >math is reached? I know this entirely arbitrary, but it would be >interesting and obviously benificial if we could easily find and >fix more instances of this in a somewhat automated fashion. Hmmm...not sure if I'm following you. The 64bit math happens when quad variables are involved in the divide. It might be possible to come up with an optimization to qdivrem (and similar functions) that check the dividend and divisor to see if the two values are less than 32 bits large, and then do a standard 32bit/32bit hardware divide. I think this might catch a vary common case where 64bit math wasn't really needed and save a few thousand instructions as a result. Calcru() is a tough critter - it would be real nice if Bruce (or anyone) could give me some thoughts on that. -DG D.G.Lawrence Download Technologies, Inc. - http://www.downloadtech.com - (866) 399 8500 TeraSolutions, Inc. - http://www.terasolutions.com - (503) 288 9544 The FreeBSD Project - http://www.freebsd.org Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message