qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC][PATCH 4/9] buffer_is_zero: use vector optimizatio


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC][PATCH 4/9] buffer_is_zero: use vector optimizations if possible
Date: Tue, 12 Mar 2013 10:09:35 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

On 03/12/2013 10:03 AM, Peter Lieven wrote:

>>> +    if (((uintptr_t) buf) % sizeof(VECTYPE) == 0
>>> +          && len % 8*sizeof(VECTYPE) == 0) {
>>
>> Space around binary operators.  Use CHAR_BITS instead of a magic number
>> 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.

-- 
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]