qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][PATCH 7/9] bitops: use vector algorithm to optimi


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC][PATCH 7/9] bitops: use vector algorithm to optimize find_next_bit()
Date: Tue, 12 Mar 2013 10:04:42 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

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.
> 
> compared to loop unrolling this adds another 50% performance
> benefit for skipping large areas of zeroes.
> 
> Signed-off-by: Peter Lieven <address@hidden>
> ---
>  util/bitops.c |   23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)

> +        if (((uintptr_t) p) % sizeof(VECTYPE) == 0
> +              && size >= BITS_PER_BYTE*8*sizeof(VECTYPE)) {

Spaces around binary operators.  CHAR_BITS instead of magic 8.

> +          unsigned long tmp2 =
> +              buffer_find_nonzero_offset(p, ((size/BITS_PER_BYTE) &
> ~(8*sizeof(VECTYPE)-1)));

Spaces around binary operators.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]