From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFReE-0006eh-MI for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:02:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFReA-0007OD-Te for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:01:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFReA-0007MN-Ki for qemu-devel@nongnu.org; Tue, 12 Mar 2013 12:01:50 -0400 Message-ID: <513F5169.4080704@redhat.com> Date: Tue, 12 Mar 2013 10:01:45 -0600 From: Eric Blake MIME-Version: 1.0 References: <513F4EC7.6010109@dlhnet.de> In-Reply-To: <513F4EC7.6010109@dlhnet.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2SRKSOMHMAPGEIAFPOTTM" 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) ------enig2SRKSOMHMAPGEIAFPOTTM Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/12/2013 09:50 AM, Peter Lieven wrote: > performance gain on SSE2 is approx. 20-25%. altivec > is not tested. performance for unsigned long arithmetic > is unchanged. >=20 > Signed-off-by: Peter Lieven > --- > util/cutils.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/util/cutils.c b/util/cutils.c > index a09d8e8..23f0cd6 100644 > --- a/util/cutils.c > +++ b/util/cutils.c > @@ -186,6 +186,11 @@ bool buffer_is_zero(const void *buf, size_t len) > * latency. > */ >=20 > + 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 number 8. Also, did you mean: len % (CHAR_BITS * sizeof(VECTYPE)) instead of what you wrote as '(len % 8) * sizeof(VECTYPE)'? > + return buffer_find_nonzero_offset(buf, len)=3D=3Dlen; > + } > + > size_t i; > long d0, d1, d2, d3; > const long * const data =3D buf; --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2SRKSOMHMAPGEIAFPOTTM 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/ iQEcBAEBCAAGBQJRP1FpAAoJEKeha0olJ0NqElIH/jvekOSDvCme1PsPx2Vhy/hw ZSXg52OEfh1modHzTzFHqzqR70aYLavkDVo0BS7euWwV1PZ+BRG3t6RkaoUzY9DX ovVsHEntHuk9UGVMfcaAYNPGYKJ5j4yuQJL3P129GaTdTdHftdG253OyIFberDN7 sF8CKK6dCQJPT3gznWNYGF9uQ5aeN9GQ4omv2HDPjbi5H/e5xOKCPXT4BFEYCL/1 3YPDrT2OeDA3dlSTdc1/kvENkAJZU/CdvlChxTjXVTkkFjiSeX+j2pntIbAdInjN 6zvrMAiX3BYU89khpAs57P9lHeydaWlbYY6EOxQL5ZHPjVrbRXjPiukVbMl/yaI= =Shgw -----END PGP SIGNATURE----- ------enig2SRKSOMHMAPGEIAFPOTTM--