From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRlo-0001P6-BX for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:09:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFRlj-00024P-SX for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:09:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRlj-00024L-Jr for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:09:39 -0400 Message-ID: <513F533F.1010605@redhat.com> Date: Tue, 12 Mar 2013 10:09:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <513F4EC7.6010109@dlhnet.de> <513F5169.4080704@redhat.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2EEUFWDCIAHIWJTWMIXXQ" Subject: Re: [Qemu-devel] [RFC][PATCH 4/9] buffer_is_zero: use vector optimizations if possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , "qemu-devel@nongnu.org" , Orit Wasserman This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2EEUFWDCIAHIWJTWMIXXQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/12/2013 10:03 AM, Peter Lieven wrote: >>> + if (((uintptr_t) buf) % sizeof(VECTYPE) =3D=3D 0 >>> + && len % 8*sizeof(VECTYPE) =3D=3D 0) { >> >> Space around binary operators. Use CHAR_BITS instead of a magic numbe= r >> 8. > the 8 is not BITS_PER_BYTE or CHAR_BITS its the number of > vectors in one loop in buffer_find_nonzero_offset(). I will add > a constant for this to make it clearer. Indeed, now I see it - 8 is the unroll factor. Well, all the more evidence that a named constant makes the code easier to read, compared to me mis-interpreting the magic number. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2EEUFWDCIAHIWJTWMIXXQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRP1M/AAoJEKeha0olJ0NqyFwH/18u3eejpM9GU2XyFNl3yHna hsH3fna20tmVnHZsSSxxATqYPZdOVHoSiY7mcGdOYoItgphXGhUiEzqUhsKUN9VI Lib/p6SUIWDOm8Iw3iLCK69OyWHEujr9NOYFYqKOo9W6+hy1ylY/dTBp+FTNpSMN jkre40GDx/+pyLDPDgeuj4nEws5/YvZD5Z7PGC4AjUs2AyeIx8ql5q2dEPIwq/n4 0we3DwmCW1pgiucYQ+pNK3iGuT2/vE+/K+7xuU7ahLbnpooNYhDgdCTm66C0gevG Rg6RHgfiZ+or3/iXabacuPC1jOwumBQqiUK1c9N+efwMBiwsO+TGk5pMPUSMCAc= =d792 -----END PGP SIGNATURE----- ------enig2EEUFWDCIAHIWJTWMIXXQ--