From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRih-0006FK-Uo for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:06:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFRie-00011n-0X for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:06:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFRid-00011h-Mq for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:06:27 -0400 Message-ID: <513F521A.9080700@redhat.com> Date: Tue, 12 Mar 2013 10:04:42 -0600 From: Eric Blake MIME-Version: 1.0 References: <513F4F4E.1060009@dlhnet.de> In-Reply-To: <513F4F4E.1060009@dlhnet.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2RKGIBILEOEWFQKHDXLID" Subject: Re: [Qemu-devel] [RFC][PATCH 7/9] bitops: use vector algorithm to optimize find_next_bit() 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) ------enig2RKGIBILEOEWFQKHDXLID Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/12/2013 09:52 AM, Peter Lieven wrote: > this patch adds the usage of buffer_find_nonzero_offset() > to skip large areas of zeroes. >=20 > compared to loop unrolling this adds another 50% performance > benefit for skipping large areas of zeroes. >=20 > Signed-off-by: Peter Lieven > --- > util/bitops.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > + if (((uintptr_t) p) % sizeof(VECTYPE) =3D=3D 0 > + && size >=3D BITS_PER_BYTE*8*sizeof(VECTYPE)) { Spaces around binary operators. CHAR_BITS instead of magic 8. > + unsigned long tmp2 =3D > + buffer_find_nonzero_offset(p, ((size/BITS_PER_BYTE) & > ~(8*sizeof(VECTYPE)-1))); Spaces around binary operators. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2RKGIBILEOEWFQKHDXLID 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/ iQEcBAEBCAAGBQJRP1IaAAoJEKeha0olJ0NqK44H/1h4q9TJMSC57hD/5yQ/VUec Fo5TRD4hu+Se1Sk1Jk1aBZic4dTvMpcRlmWTEKiKG9xaiu3krLPlSTJuQjtkFuIn WIVREShWf5TCCDxHWvYynS9LALMGwARDBNiQSAaaSDqognFTLS7IkHLMu8vjHtoO 6LzEa/h0GsPX5P3DIjQk6uSq3TB8cdrLoJ8TJ+4q0rGMMc4UFKdxA5T9SFGcGi/u IiEH5XvqhAzLdnQqaMUtrpv/DxriVwIspeVKxPdVraPvxnGLR+bppqjRng8p1pR5 8uXgmW85asHEXOJ2sYvl3unBH2x9BjgUZE+M6vj0Ec0bzvdsndsb+UVeTQSrkPY= =/xx2 -----END PGP SIGNATURE----- ------enig2RKGIBILEOEWFQKHDXLID--