Mesa (gallium-0.2): util: Add log2() definition for MSC.

Michał Król michal at kemper.freedesktop.org
Wed Nov 12 17:20:52 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: 50357ad35181b7b170abe8413d4ef772978aa5f5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=50357ad35181b7b170abe8413d4ef772978aa5f5

Author: Michal Krol <michal at tungstengraphics.com>
Date:   Wed Nov 12 17:14:07 2008 +0100

util: Add log2() definition for MSC.

---

 src/gallium/auxiliary/util/u_math.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index d2eaa2e..6227211 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -161,6 +161,11 @@ static INLINE float logf( float f )
    return (float) log( (double) f );
 }
 
+static INLINE double log2( double x )
+{
+   return log( x ) / log( 2.0 );
+}
+
 #else
 /* Work-around an extra semi-colon in VS 2005 logf definition */
 #ifdef logf




More information about the mesa-commit mailing list