From owner-svn-src-all@FreeBSD.ORG Thu Feb 28 16:25:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1642D5E6; Thu, 28 Feb 2013 16:25:23 +0000 (UTC) Date: Thu, 28 Feb 2013 16:25:23 +0000 From: Alexey Dokuchaev To: Davide Italiano Subject: Re: svn commit: r247460 - head/sys/dev/acpica Message-ID: <20130228162522.GA41693@FreeBSD.org> References: <201302281127.r1SBR2VE068276@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201302281127.r1SBR2VE068276@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 16:25:23 -0000 On Thu, Feb 28, 2013 at 11:27:02AM +0000, Davide Italiano wrote: > New Revision: 247460 > URL: http://svnweb.freebsd.org/changeset/base/247460 > > Log: > MFcalloutng (r247427 by mav): > We don't need any precision here. Let it be fast and dirty shift then > slow and excessively precise 64-bit division. > > - if (sbt >= 0 && us > sbt / SBT_1US) > - us = sbt / SBT_1US; > + if (sbt >= 0 && us > (sbt >> 12)) > + us = (sbt >> 12); Does this really buy us anything? Modern compilers should be smart enough to generate correct code. Do you have evidence that this is not the case here? Not to mention that it obfuscates the code by using some magic constant. ./danfe