[Mesa-dev] [PATCHv2 05/21] mesa: android has no log2f nor ffs

Chad Versace chad at chad-versace.us
Fri Aug 19 10:14:44 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Reviewed-by: Chad Versace <chad at chad-versace.us>

On 08/18/2011 07:37 PM, Chia-I Wu wrote:
> Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs.
> ---
>  src/mesa/main/imports.h |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
> index 3fa1db0..70defdc 100644
> --- a/src/mesa/main/imports.h
> +++ b/src/mesa/main/imports.h
> @@ -134,7 +134,13 @@ typedef union { GLfloat f; GLint i; } fi_type;
>  #define exp2f(f) ((float) exp2(f))
>  #define floorf(f) ((float) floor(f))
>  #define logf(f) ((float) log(f))
> +
> +#ifdef ANDROID
> +#define log2f(f) (logf(f) * (float) (1.0 / M_LN2))
> +#else
>  #define log2f(f) ((float) log2(f))
> +#endif
> +
>  #define powf(x,y) ((float) pow(x,y))
>  #define sinf(f) ((float) sin(f))
>  #define sinhf(f) ((float) sinh(f))
> @@ -562,7 +568,7 @@ _mesa_init_sqrt_table(void);
>  
>  #ifdef __GNUC__
>  
> -#ifdef __MINGW32__
> +#if defined(__MINGW32__) || defined(ANDROID)
>  #define ffs __builtin_ffs
>  #define ffsll __builtin_ffsll
>  #endif
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOTpoEAAoJEAIvNt057x8iJTwQAMBTR94B27F4oFw/HqGfmUcl
1bxYZK1/wbcBigxpmRC0FH3LHMzSQVSvYw8A/NtPNJ0MYYeHDa2/QpvBc5aWge4J
bph/4Tm5ByAiyY1w4Hi+t9i+m4x5KBTvl8wZVZ8QCmV/wJDCjsr4bebAoEyFj0jY
IlmrWTH6hppcy9Y+DwTdAsPhdQcLoOfHH4lzT0Uv8FOjSqOW87IBAtEmn4iETlaE
hnpfLmwLA5Qha+f0Y5m+9gQ1qhKg0qkRUbwm6n46hAk8FW1Cw80/VtEvKQhNe2hM
Xy/Ns3i6dVBIc2E+AIvwTDG3+FGTxu4gfgvHidNwXjjr8QJ2oed5Tj4Sroqk50nZ
Ipx5NCdtoIeoNBgI9Knys94QXiiNkaCftjvBGigdNL+5kVqWr37HY9mo+o/A5p2g
/RlXG5aevHHQufxqKwXTkvXeIk3mkia16+0LxiW+8P2otwzVzTV3ChQMy1WrayfK
5LoxvnQjBhPxPKboMzMTMvtZVdaVXa8Ar/dHfqk5XiQYquB2liKa6tYJNn4weUDd
ADRb3bDVbYER7S+x56MDHmU+By21gtLFgiB/YY1i01D57QGkP4NZCM+s65baRM1N
2Zs+D87G0mD9RtGnu7Bc9FWOmS6lu9dcpy9VvBeEmRnmMhs4mYNUHFCjk9uS85Da
nLBzXu4/7OsgdWXtHCd/
=wJE0
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list