[Mesa-dev] [PATCH 5/6] gallium/util: Add an implementation of ffsl

Kenneth Graunke kenneth at whitecape.org
Mon Sep 14 11:41:39 PDT 2015


On Saturday, August 15, 2015 11:31:26 AM Jason Ekstrand wrote:
> ---
>  src/gallium/auxiliary/util/u_math.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
> index 56bd185..5814421 100644
> --- a/src/gallium/auxiliary/util/u_math.h
> +++ b/src/gallium/auxiliary/util/u_math.h
> @@ -391,6 +391,18 @@ unsigned ffs( unsigned u )
>  
>  #endif /* FFS_DEFINED */
>  
> +#ifndef FFSL_DEFINED
> +#define FFSL_DEFINED 1
> +
> +#ifdef _MSC_VER
> +/* With MSVC, int and long are the same type even on 64-bit */
> +#define ffsl ffs
> +#else
> +#define ffsl(x) ((sizeof(long) == sizeof(int)) ? ffs(x) : ffsll(x))
> +#endif
> +
> +#endif /* FFSL_DEFINED */
> +
>  /**
>   * Find first bit set in long long.  Least significant bit is 1.
>   * Return 0 if no bits set.
> 

I noticed this patch never landed; Marek reviewed it.

Still worth pushing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150914/63de0ce4/attachment.sig>


More information about the mesa-dev mailing list