Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 2002 22:32:11 -0700
From:      David Greenman-Lawrence <dg@dglawrence.com>
To:        Alfred Perlstein <bright@mu.org>
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>
In-Reply-To: <20020816052726.GN75574@elvis.mu.org>; from bright@mu.org on Thu, Aug 15, 2002 at 10:27:26PM -0700
References:  <200208160508.g7G58kRZ098250@freefall.freebsd.org> <20020815221609.E42978@nexus.root.com> <20020816052726.GN75574@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>>    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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020815223211.F42978>