From owner-svn-src-head@FreeBSD.ORG Thu Feb 28 16:46:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 941C7E0A; Thu, 28 Feb 2013 16:46:15 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-oa0-f46.google.com (mail-oa0-f46.google.com [209.85.219.46]) by mx1.freebsd.org (Postfix) with ESMTP id 17E6310D; Thu, 28 Feb 2013 16:46:14 +0000 (UTC) Received: by mail-oa0-f46.google.com with SMTP id k1so3960679oag.19 for ; Thu, 28 Feb 2013 08:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=fywfp9U4kaC1JGHS+KnXUaSAc0T+nPxqHdk8LVeUpUA=; b=Ee273WLIjNqmxEPgkAJsBbzKFlPCzEmNmOFmuBH+j72HCHnYRPffDSjJorzQ/M1H+R 9O+DP++aVTJ62ih+YqcA3lUm3peW7DiXOpo8Yf4kg7qUADEiSo0Tr4tSqUOmn6uXKrEB zLTyLyermTltpPzllVPiVRhyqcFoGfFPSQ+hv8pGcpz0rRmCMDx+7bHv4XfH7sUM5ltu E7eh2goc7DQdwlVDNUaOWOpiQPWasRbN6nOdR3vBSagFHT1Zh0CMx4FjrzV7AlFMhriK D9jI9TkJohK1TiI0q6CCf+SvWXaTFVYF+yue2WtYMv+W1tE5Zuxn4ke6jT8m+zlDowkD On8g== MIME-Version: 1.0 X-Received: by 10.60.172.84 with SMTP id ba20mr6060780oec.10.1362069974546; Thu, 28 Feb 2013 08:46:14 -0800 (PST) Received: by 10.76.109.236 with HTTP; Thu, 28 Feb 2013 08:46:14 -0800 (PST) In-Reply-To: <20130228162522.GA41693@FreeBSD.org> References: <201302281127.r1SBR2VE068276@svn.freebsd.org> <20130228162522.GA41693@FreeBSD.org> Date: Thu, 28 Feb 2013 11:46:14 -0500 Message-ID: Subject: Re: svn commit: r247460 - head/sys/dev/acpica From: Ryan Stone To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 16:46:15 -0000 On Thu, Feb 28, 2013 at 11:25 AM, Alexey Dokuchaev wrote: > 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 > SBT_1US is 4294, not 4096 (1 << 12). This is an approximation, which the compiler obviously can't automatically apply.