qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 2/2] bitops: fix types


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH v3 2/2] bitops: fix types
Date: Mon, 16 Jul 2012 18:25:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

On 07/14/2012 03:34 PM, Blue Swirl wrote:
> bitops.h uses inconsistently 'unsigned long' and 'int' for bit numbers.
> 
> Unify to 'unsigned long' because it generates better code on x86_64.
> Adjust asserts accordingly.
> 


Actually, plain unsigned generates the best code.  unsigned longs
require an extra byte for many instructions.  It also requires more
stack space if spilled.  Unsigned does not, but is compatible with
unsigned long in case it needs to be used in pointer arithmetic (unlike
signed int which needs a sign extension instruction).

-- 
error compiling committee.c: too many arguments to function





reply via email to

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