From owner-svn-src-all@FreeBSD.ORG Fri Jan 16 08:21:47 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA521065670 for ; Fri, 16 Jan 2009 08:21:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8328FC1A for ; Fri, 16 Jan 2009 08:21:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 1EBAE8FC53 for ; Fri, 16 Jan 2009 11:21:46 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 3790E8FC18; Fri, 16 Jan 2009 11:21:42 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id E8DF63996C; Fri, 16 Jan 2009 11:21:43 +0300 (MSK) Date: Fri, 16 Jan 2009 11:21:39 +0300 From: Stanislav Sedov To: "M. Warner Losh" Message-Id: <20090116112139.fd8f0c4a.stas@FreeBSD.org> In-Reply-To: <20090115.175500.692488694.imp@bsdimp.com> References: <20090115114407.GA67726@FreeBSD.org> <496F24D8.2040104@gmx.de> <496FC32F.3040104@FreeBSD.org> <20090115.175500.692488694.imp@bsdimp.com> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Jan 16 11:21:45 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 49704399967005350815758 Cc: sobomax@FreeBSD.org, danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, gonzo@FreeBSD.org, svn-src-head@FreeBSD.org, christoph.mallon@gmx.de Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 16 Jan 2009 08:21:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 15 Jan 2009 17:55:00 -0700 (MST) "M. Warner Losh" mentioned: > In message: <496FC32F.3040104@FreeBSD.org> > Maxim Sobolev writes: > : Christoph Mallon wrote: > : > Alexey Dokuchaev schrieb: > : >> On Wed, Jan 14, 2009 at 07:05:27PM -0700, M. Warner Losh wrote: > : >>> In message: <20090115020752.52566769.stas@FreeBSD.org> > : >>> Stanislav Sedov writes: > : >>> : > + shift = 8 * (reg & 3); > : >>> : > : : Would it make sense to replace this with > : >>> : > + shift = (reg & 3) << 3; > : >>> : : to not rely on possible compiler optimizations? > : >>> > : >>> I don't think that it matters all that much these days... > : >> > : >> But the name "shift" kinda suggests << instead of *, no? > : > > : > The value *is* a shift amount (see its uses a few lines down). Its name > : > does not imply the way it is calculated, but what it is used for. > : > > : > BTW: Even the most cheap compilers emit shift instructions for > : > multiplication by a power of two. The new code also is clearly faster > : > then the old - quite some code gets generated for switches. > : > : I believe Warner's point is that the code is not in the hot path, so > : that it should not really matter either way. > > The code is clear the way it is, there's little reason to > hyper-optimize this path in the face of bogus compiler optimizations > or not, and the effort to optimize the hot-path should be aided by > dtrace or kernel profiling rather than reading the code. > Heh, that was just a suggestion, as the author decided to optimize the code anyway.:-) Of course, this optimization doesn't matter here much. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklwQ5cACgkQK/VZk+smlYH9xQCffKoCymcGgyBUKBT2HHi4jLiM L3IAn2QNrh3FsdQGMdD1H6rKMmc7YhzE =qfKk -----END PGP SIGNATURE----- !DSPAM:49704399967005350815758!