From owner-svn-src-all@FreeBSD.ORG Thu Jan 15 11:58:19 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 5FA65106570B for ; Thu, 15 Jan 2009 11:58:19 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9C1038FC19 for ; Thu, 15 Jan 2009 11:58:18 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 15 Jan 2009 11:58:17 -0000 Received: from p54A3E43A.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.228.58] by mail.gmx.net (mp035) with SMTP; 15 Jan 2009 12:58:17 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+duycmTJGdrxeCrUrbNhF1W0hu4mDXJ0Bp3k3Wzy dxAE9i3gFKhiue Message-ID: <496F24D8.2040104@gmx.de> Date: Thu, 15 Jan 2009 12:58:16 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Alexey Dokuchaev References: <200901142232.n0EMWhGw055895@svn.freebsd.org> <20090115020752.52566769.stas@FreeBSD.org> <20090114.190527.1058804377.imp@bsdimp.com> <20090115114407.GA67726@FreeBSD.org> In-Reply-To: <20090115114407.GA67726@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.58 Cc: 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-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: Thu, 15 Jan 2009 11:58:20 -0000 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.