From owner-svn-src-all@FreeBSD.ORG Fri Jun 21 06:32:52 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E90DB28; Fri, 21 Jun 2013 06:32:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B46FC1C09; Fri, 21 Jun 2013 06:32:51 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r5L6WmdV095819; Fri, 21 Jun 2013 09:32:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r5L6WmdV095819 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r5L6Wm5T095818; Fri, 21 Jun 2013 09:32:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 21 Jun 2013 09:32:48 +0300 From: Konstantin Belousov To: Lawrence Stewart Subject: Re: svn commit: r252032 - head/sys/amd64/include Message-ID: <20130621063248.GN91021@kib.kiev.ua> References: <201306201430.r5KEU4G5049115@svn.freebsd.org> <51C3B73C.70900@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Lv9rZMuwYml21e6Z" Content-Disposition: inline In-Reply-To: <51C3B73C.70900@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home 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: Fri, 21 Jun 2013 06:32:52 -0000 --Lv9rZMuwYml21e6Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 21, 2013 at 12:15:24PM +1000, Lawrence Stewart wrote: > Hi Kostik, >=20 > On 06/21/13 00:30, Konstantin Belousov wrote: > > Author: kib > > Date: Thu Jun 20 14:30:04 2013 > > New Revision: 252032 > > URL: http://svnweb.freebsd.org/changeset/base/252032 > >=20 > > Log: > > Allow immediate operand. > > =20 > > Sponsored by: The FreeBSD Foundation > >=20 > > Modified: > > head/sys/amd64/include/counter.h > >=20 > > Modified: head/sys/amd64/include/counter.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/amd64/include/counter.h Thu Jun 20 14:20:03 2013 (r252031) > > +++ head/sys/amd64/include/counter.h Thu Jun 20 14:30:04 2013 (r252032) > > @@ -44,7 +44,7 @@ counter_u64_add(counter_u64_t c, int64_t > > =20 > > __asm __volatile("addq\t%1,%%gs:(%0)" > > : > > - : "r" ((char *)c - (char *)&__pcpu[0]), "r" (inc) > > + : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc) > > : "memory", "cc"); > > } >=20 > For mere mortals like myself, a verbose explanation of what this does, > why it's necessary and what problem(s) it solves (if any) would be most > helpful :) It does what was written in the commit message. The addq instructions is allowed to take the immediate operand, besides the register, for the increment value. For the typical case of incrementing by the constant 1, before the commit, the emited code was like movl $1,%ecx addq %ecx,%gs(%rdx) now it could be addq $1,%gs(%rdx) Mostly aestetic, also slightly lowering the registers pressure. --Lv9rZMuwYml21e6Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJRw/OPAAoJEJDCuSvBvK1BFQQP/2o51rsAef7M6zzoHUnMMfJQ UknRxPbEEnbwgiZdEsIvPMZCQaF7Ohs/BJdGF5WHt8X9U93smhxzfPGyeseRLZ0f ZO0F0s22HEPepoXfB6iQHwi8+MecGYqc1Y9OTqIlk7zxVPCgFgSRX6FTxV211fNl NkSRzsmKp7GsFT8/qPbUqmlWri+SdSvNy1OvZnVH8bh/7MuXslmSVVmvvSV7HMaB aghcVobKosRDqimXDI4P3AVMIXYrpc7/e0DwEERxB3pSeUmsq7pL51OlkQTZpQQy OhNbG52LO690l1eE1p2o71zxBnlYTQNAlDVoFcwGeIwtVvJW/3w4XI362BiarY8o r0lS3Y8rSiD0etBNq+JOner1PMPc8F/qx/a9s8fA/wgd2WI56n3pwGTIaYMnuq0s I0L9XE0rng4SbziUs+R3qfHeC4cCsjuY3OiNb+P7zSCJGaBhNfd8ocht0ulHVQa1 0WjKvpMrbyw6iknA+SPJ0LhkseAUvRfTn/OVNitRlZCeBw39jON05swerJg0SvqX lUTl4GwJSXoDgW+bFqbhUt9nDtv5WCdLzTh48YjxuVuMmOkye30RCy7c5DWxl5cE rn3Ooh8ZNwtxR5kvWyr90cfW4UyEmep1AKb0pYJnpTYBbh78mlovibq/YAP5jf8j JG7mBrVkryvAj4aQEhqo =528p -----END PGP SIGNATURE----- --Lv9rZMuwYml21e6Z--