From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK38x-0001zs-HP for qemu-devel@nongnu.org; Mon, 25 Mar 2013 04:52:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UK38u-0002uu-P8 for qemu-devel@nongnu.org; Mon, 25 Mar 2013 04:52:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK38u-0002uj-Hn for qemu-devel@nongnu.org; Mon, 25 Mar 2013 04:52:36 -0400 Message-ID: <51501099.7040504@redhat.com> Date: Mon, 25 Mar 2013 10:53:45 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1363956370-23681-1-git-send-email-pl@kamp.de> <1363956370-23681-4-git-send-email-pl@kamp.de> In-Reply-To: <1363956370-23681-4-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv4 3/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: Stefan Hajnoczi , Paolo Bonzini , qemu-devel@nongnu.org, quintela@redhat.com On 03/22/2013 02:46 PM, Peter Lieven wrote: > performance gain on SSE2 is approx. 20-25%. altivec > is not tested. performance for unsigned long arithmetic > is unchanged. > > Signed-off-by: Peter Lieven > Reviewed-by: Eric Blake > --- > util/cutils.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/util/cutils.c b/util/cutils.c > index 41c627e..0f43c22 100644 > --- a/util/cutils.c > +++ b/util/cutils.c > @@ -205,6 +205,11 @@ bool buffer_is_zero(const void *buf, size_t len) > long d0, d1, d2, d3; > const long * const data = buf; > > + /* use vector optimized zero check if possible */ > + if (can_use_buffer_find_nonzero_offset(buf, len)) { > + return buffer_find_nonzero_offset(buf, len) == len; > + } > + > assert(len % (4 * sizeof(long)) == 0); > len /= sizeof(long); > > Reviewed-by: Orit Wasserman