From owner-svn-src-head@FreeBSD.ORG Thu Jan 15 23:14:22 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71B6106567B; Thu, 15 Jan 2009 23:14:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id A8AED8FC1D; Thu, 15 Jan 2009 23:14:22 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id n0FNEISH022696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Jan 2009 15:14:19 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <496FC32F.3040104@FreeBSD.org> Date: Thu, 15 Jan 2009 15:13:51 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Christoph Mallon References: <200901142232.n0EMWhGw055895@svn.freebsd.org> <20090115020752.52566769.stas@FreeBSD.org> <20090114.190527.1058804377.imp@bsdimp.com> <20090115114407.GA67726@FreeBSD.org> <496F24D8.2040104@gmx.de> In-Reply-To: <496F24D8.2040104@gmx.de> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexey Dokuchaev , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, stas@FreeBSD.org, gonzo@FreeBSD.org, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 15 Jan 2009 23:14:23 -0000 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. -Maxim