Il 14/11/2013 06:51, Alexey Kardashevskiy ha scritto:
>> > The wrappers are not usable where you have constant expressions as in
>> > your case. So your original patch is good IMO, except for the __ at the
>> > beginning of __BITNR.
>
> There are 2 macros, one (BITNR) uses the other (__BITNR). Wh
On 11/13/2013 11:04 PM, Paolo Bonzini wrote:
> Il 13/11/2013 03:40, Alexey Kardashevskiy ha scritto:
>> I looked further and did not find any use of ffs/clz so I wonder what did
>> you mean about bitops.h and what did I miss? I am confused.
>
> It's host-utils.h actually. The reason for the wrapp
Il 13/11/2013 03:40, Alexey Kardashevskiy ha scritto:
> I looked further and did not find any use of ffs/clz so I wonder what did
> you mean about bitops.h and what did I miss? I am confused.
It's host-utils.h actually. The reason for the wrappers is twofold:
(1) provide 32/64-bit functions inst
On 11/11/2013 10:57 PM, Andreas Färber wrote:
> Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy:
>> This adds a macro to calculate the highest bit set.
>
> Isn't that already available as ffs / clz GCC builtin with wrapper in
> qemu/bitops.h? What's the difference to your macro? CC'ing Paolo.
On 11/11/2013 10:57 PM, Andreas Färber wrote:
> Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy:
>> This adds a macro to calculate the highest bit set.
>
> Isn't that already available as ffs / clz GCC builtin with wrapper in
> qemu/bitops.h? What's the difference to your macro? CC'ing Paolo.
>
Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy:
> This adds a macro to calculate the highest bit set.
Isn't that already available as ffs / clz GCC builtin with wrapper in
qemu/bitops.h? What's the difference to your macro? CC'ing Paolo.
Andreas
> If used on constant
> values, no code will be
This adds a macro to calculate the highest bit set. If used on constant
values, no code will be generated.
Signed-off-by: Alexey Kardashevskiy
---
include/qemu/bitops.h | 12
1 file changed, 12 insertions(+)
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 304c90c..