Hi Tom,
> The other thing I didn't like about the patch was the assumption that
> it's okay to have a "static inline" function in a header. You can
> get away with that in gcc but *not* in other compilers.
Gee, you user-space guys have it tough! :D
Point taken, will rework.
> Look at the exist
Florian Weimer writes:
> * Jeremy Kerr:
>> Because now we have to test the compiler *and* the version as well?
> This builtin is not architecture-specific, so you'd save the
> architecture check.
The appropriate way to handle it would be a configure probe to see if
the function is available, thu
* Jeremy Kerr:
> Florian,
>
>> > +#if defined(__GNUC__) && \
>> > + (defined(__ppc__) || defined(__powerpc__) || \
>> > + defined(__ppc64__) || defined (__powerpc64__))
>>
>> If you require GCC anyway, you can use __builtin_clz instead.
>> (It's been available since GCC 4.1 at least.)
>
> Becau
Florian,
> > +#if defined(__GNUC__) && \
> > + (defined(__ppc__) || defined(__powerpc__) || \
> > +defined(__ppc64__) || defined (__powerpc64__))
>
> If you require GCC anyway, you can use __builtin_clz instead.
> (It's been available since GCC 4.1 at least.)
Because now we have to test the
* Jeremy Kerr:
> +#if defined(__GNUC__) && \
> + (defined(__ppc__) || defined(__powerpc__) || \
> + defined(__ppc64__) || defined (__powerpc64__))
If you require GCC anyway, you can use __builtin_clz instead.
(It's been available since GCC 4.1 at least.)
--
Florian Weimer
Add a utility header for simple bit operatios - bitops.h.
At present, just contains the fls() (find last set bit) function.
Signed-off-by: Jeremy Kerr
---
v2: only use inline asm with gcc
---
src/include/utils/bitops.h | 53 +
1 file changed, 53 i