aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_math.h
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2008-11-12 19:02:41 +0100
committerMichal Krol <[email protected]>2008-11-12 19:02:41 +0100
commit0d8637451b7bf1aac164dba6d269d1a665160ea3 (patch)
treeb0c4d7d49c96501aa87ca6ae95d245249f83c2ef /src/gallium/auxiliary/util/u_math.h
parentf447eea4de9cab5de295c717d35824cf92b9f322 (diff)
util: Optimise log2().
Diffstat (limited to 'src/gallium/auxiliary/util/u_math.h')
-rw-r--r--src/gallium/auxiliary/util/u_math.h3
1 files changed, 2 insertions, 1 deletions
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