diff options
author | marha <marha@users.sourceforge.net> | 2012-10-31 09:21:05 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-10-31 09:21:05 +0100 |
commit | 67c290de36ddc1caae94c0892157ac16b90e4f99 (patch) | |
tree | 2103f7ca65b9575500965cb2fc9e03c745e75879 /mesalib/src/gallium/auxiliary/util/u_math.h | |
parent | 7b3f315a5d8b90dcb0db5512ed91fa700027cb7a (diff) | |
download | vcxsrv-67c290de36ddc1caae94c0892157ac16b90e4f99.tar.gz vcxsrv-67c290de36ddc1caae94c0892157ac16b90e4f99.tar.bz2 vcxsrv-67c290de36ddc1caae94c0892157ac16b90e4f99.zip |
mesa git update 31 oct 2012
mesa: 183e122bdfe27f875c3c121964484dae9587c051
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_math.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_math.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h index 4047bd9b0..607fbecb0 100644 --- a/mesalib/src/gallium/auxiliary/util/u_math.h +++ b/mesalib/src/gallium/auxiliary/util/u_math.h @@ -482,12 +482,16 @@ unsigned ffs( unsigned u ) */ static INLINE unsigned util_last_bit(unsigned u) { +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) + return u == 0 ? 0 : 32 - __builtin_clz(u); +#else unsigned r = 0; while (u) { r++; u >>= 1; } return r; +#endif } |