summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-11-12 19:01:46 +0100
committerMichal Krol <michal@tungstengraphics.com>2008-11-12 19:01:46 +0100
commitc5ba8ba9182a6946ee489241738457b1370b3c77 (patch)
tree239d86d30222d0d75fbba2571c9b5d4509a536b2 /src/gallium/auxiliary
parent87f77105ce7207d601ee95bc29ca8c0ea1731d78 (diff)
util: Optimise log2().
Diffstat (limited to 'src/gallium/auxiliary')
-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 62272110ce..fdaec8df82 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