From: Michal Krol Date: Wed, 12 Nov 2008 18:02:41 +0000 (+0100) Subject: util: Optimise log2(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d8637451b7bf1aac164dba6d269d1a665160ea3;p=mesa.git util: Optimise log2(). --- diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index c7bbebc4286..aee69ab7bae 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -163,7 +163,8 @@ static INLINE float logf( float f ) static INLINE double log2( double x ) { - return log( x ) / log( 2.0 ); + const double invln2 = 1.442695041; + return log( x ) * invln2; } #else